mirror of
https://github.com/appgurueu/modlib.git
synced 2024-08-20 13:24:11 +02:00
b3d: add support for positive nan
This commit is contained in:
parent
ca6757f326
commit
8c97425fbc
5
b3d.lua
5
b3d.lua
@ -63,8 +63,9 @@ function read(stream)
|
|||||||
if mantissa == 0 then
|
if mantissa == 0 then
|
||||||
return sign * math.huge
|
return sign * math.huge
|
||||||
end
|
end
|
||||||
-- TODO differentiate quiet and signalling NaN as well as positive and negative
|
-- Differentiating quiet and signalling nan is not possible in Lua, hence we don't have to do it
|
||||||
return 0/0
|
-- HACK ((0/0)^1) yields nan, 0/0 yields -nan
|
||||||
|
return sign == 1 and ((0/0)^1) or 0/0
|
||||||
end
|
end
|
||||||
if exponent == 0 then
|
if exponent == 0 then
|
||||||
-- subnormal value
|
-- subnormal value
|
||||||
|
Loading…
Reference in New Issue
Block a user