racket/collects/racket/flonum.rkt
Noel Welsh cfa7b727f4 Fix some errors with in-vector and derived forms:
- Range checking was inconsistent between the sequence and macro forms
- The macro form could crash due to unsafe vector refs

Fixes involved refactoring the range checks so they are shared between both versions, and changing the contract slightly so start and stop are checked before the sequence runs. This allows unsafe vector refs and earlier error notifications at the cost making some valid programs (e.g. those using some condition to stop a comprehension hitting an invalid index) now be invalid. Only crazy people would rely on the old behaviour, so it isn't a problem in practice.
2010-12-13 13:38:35 +00:00

29 lines
876 B
Racket

#lang racket/base
(require '#%flfxnum
"private/vector-wraps.rkt"
"unsafe/ops.rkt"
(for-syntax racket/base))
(provide fl+ fl- fl* fl/
flabs flsqrt flexp fllog
flsin flcos fltan flasin flacos flatan
flfloor flceiling flround fltruncate
fl= fl< fl<= fl> fl>= flmin flmax
->fl fl->exact-integer
flvector? flvector make-flvector
shared-flvector make-shared-flvector
flvector-length flvector-ref flvector-set!
flvector-copy
flreal-part flimag-part make-flrectangular
in-flvector for/flvector for*/flvector)
(define-vector-wraps "flvector"
flvector? flvector-length flvector-ref flvector-set! make-flvector
unsafe-flvector-ref unsafe-flvector-set! unsafe-flvector-length
in-flvector*
in-flvector
for/flvector
for*/flvector
flvector-copy)