CultMath: cycles_power has no int-range quirk (Blender returns 1 for (-1)^(2^31)); math.json regenerated with the -1 base and Compare epsilon cases
The oracle showed Cycles treats a huge exponent as integral for a negative base, so the speculative b >= 2^31 rule is gone. CultMath.Cycles.glsl is stale at this commit (the HLSL changed), so CommittedGlslEqualsLowering fails here; the regenerated file follows. Builds. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
602c88444d
commit
7d42eb3f20
4 changed files with 17 additions and 20 deletions
|
|
@ -35,13 +35,12 @@ public static partial class math
|
|||
|
||||
/// <summary>
|
||||
/// Math node Power (safe_powf with compatible_powf): 0 for a negative base with a fractional exponent,
|
||||
/// 1 for exponent 0, 0 for base 0. A negative base takes an integral exponent's parity. An exponent past
|
||||
/// the int range counts as fractional for a negative base, where Cycles' int round trip cannot hold it.
|
||||
/// 1 for exponent 0, 0 for base 0. A negative base takes an integral exponent's parity.
|
||||
/// </summary>
|
||||
public static float cycles_power(float a, float b)
|
||||
{
|
||||
var whole = b >= 0.0f ? floor(b) : ceil(b);
|
||||
if (a < 0.0f && (b != whole || b >= 2147483648.0f || b < -2147483648.0f))
|
||||
if (a < 0.0f && b != whole)
|
||||
return 0.0f;
|
||||
if (b == 0.0f)
|
||||
return 1.0f;
|
||||
|
|
|
|||
Loading…
Reference in a new issue