Skip to content

Non-zero result of Vector3.Cross with parallel vectors #114361

@sunghwan2789

Description

@sunghwan2789

Description

Vector3.Cross with parallel vectors produce different results within .NET 8 and .NET 9

Reproduction Steps

using System.Numerics;

var v = new Vector3(-1, 1, 0);
var n = Vector3.Normalize(v);
var c = Vector3.Cross(n, n);
System.Diagnostics.Debug.Assert(c == Vector3.Zero);

Expected behavior

c is Vector3.Zero

Actual behavior

c is non-zero(new Vector3(0,0,1.26880515E-08f))

Regression?

This is regression from .NET 9

Known Workarounds

No response

Configuration

  • cpu: AMD Ryzen 7 5800H
  • architecture: x64

Other information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions