Unsupported Float80 math functions and min/max behavior with Nan


(Antonino) #1

- Why Swift continues to not support Float80 math functions?
Example:

print("\( log( Float( 1.0 ) ) )")
print("\( log( Double( 1.0 ) ) )")
// print("\( log( Float80( 1.0 ) ) )") // don’t compile and logl is unavailable

- Why min and max continue to not act like fmin and fmax (IEEE 754 standard)?
Example:

print("\( min( Double.nan,0.0 ) )") // print nan (!)
print("\( min( 0.0,Double.nan ) )") // print 0.0
print("\( max( Double.nan,0.0 ) )") // print nan (!)
print("\( max( 0.0,Double.nan ) )") // print 0.0
print("\n")

print("\( fmin( Double.nan,0.0 ) )") // print 0.0
print("\( fmin( 0.0,Double.nan ) )") // print 0.0
print("\( fmax( Double.nan,0.0 ) )") // print 0.0
print("\( fmax( 0.0,Double.nan ) )") // print 0.0