[racket] Untyped arithmetics performance

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Jan 24 15:34:50 EST 2015

At Sat, 24 Jan 2015 19:14:18 +0100, Daniel Kvasnička wrote:
> >> What about the segmentation fault? Am I doing something wrong?
> > 
> > You're missing an conversion from fixnum to flonum in the second
> > argument to `unsafe-fl/`:
> 
> At first I thought the same but (unsafe-fl/ 3.0 4) works and (flonum?
> 4) is #f …what am I missing?

"Unsafe" means that when you break the contract of `unsafe-fl/` by
providing a fixnum second argument, then anything can happen. The
result might be to crash the Racket process, or it might be the result
that `/` would have produced. Unfortunately, you can't draw any
conclusions from the result of breaking an unsafe operation's contract.



Posted on the users mailing list.