File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 88 ulp-difference ulps->bits
99 midpoint random-generate
1010 </total <=/total
11- value->string value->json
11+ value->string value->json json->value
1212 real->repr repr->real)
1313
1414(define (ulp-difference x y repr)
6262 [_ (hash 'type (~a (representation-name repr))
6363 'ordinal (~a ((representation-repr->ordinal repr) x)))]))
6464
65+ (define (json->value x repr)
66+ (match x
67+ [(? real?) x]
68+ [(? hash?)
69+ (match (hash-ref x 'type )
70+ ["real "
71+ (match (hash-ref x 'value )
72+ ["-inf " -inf.0 ]
73+ ["+inf " +inf.0 ]
74+ ["NaN " +nan.0 ]
75+ [_ +nan.0 ])]
76+ [_ ((representation-ordinal->repr repr)
77+ (string->number (hash-ref x 'ordinal )))])]))
78+
6579(define (value->string n repr)
6680 ;; Prints a number with relatively few digits
6781 (define ->bf (representation-repr->bf repr))
Original file line number Diff line number Diff line change 9191 (define-values (pts exs)
9292 (for/lists (pts exs) ([entry (in-list json)])
9393 (match-define (list pt ex) entry)
94- (values (map real->repr pt var-reprs) (real->repr ex output-repr))))
94+ (values (map real->repr pt var-reprs) (real->repr (json->value ex output-repr) output-repr))))
9595 (mk-pcontext pts exs))
9696
97- (define (pcontext->json pcontext)
97+ (define (pcontext->json pcontext repr )
9898 (for/list ([(pt ex) (in-pcontext pcontext)])
99- (list pt ex )))
99+ (list (map (curryr value->json repr) pt) (value->json ex repr) )))
Original file line number Diff line number Diff line change 368368 (define pctx (job-result-backend result))
369369
370370 (eprintf " complete\n " )
371- (hasheq 'points (pcontext->json pctx)))))
371+ (hasheq 'points (pcontext->json pctx (context-repr (test-context test)) )))))
372372
373373(define analyze-endpoint
374374 (post-with-json-response
You can’t perform that action at this time.
0 commit comments