Files
yoga/csharp/Facebook.Yoga/YogaConstants.cs
David Aurelio 0962c5220c Roll back -ffast-math
Summary:
@public

`-ffast-math` does not have measurable performance benefits.

By using `NaN` for *undefined* values again, we can squeeze `YGFloatOptional` into 32 bits.
This will also enable us to store `YGValue` (or a variant of it) in 32 bits.

Reviewed By: SidharthGuglani

Differential Revision: D13119110

fbshipit-source-id: 4e6964240bf74ebc22d8783107b89d536a1a0842
2018-12-06 07:46:23 -08:00

25 lines
560 B
C#

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
namespace Facebook.Yoga
{
public static class YogaConstants
{
public const float Undefined = float.NaN;
public static bool IsUndefined(float value)
{
return float.IsNaN(value);
}
public static bool IsUndefined(YogaValue value)
{
return value.Unit == YogaUnit.Undefined;
}
}
}