write the noise constants the C# divides as divisions

A define's body is walked and parenthesised now (sex#55). The four
written as divisions fold to exactly the doubles they replace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 18:16:06 +03:00
parent 3ff6dcaa74
commit c9daae367f

View File

@@ -7,16 +7,14 @@
(pub include stdint.h) (pub include stdint.h)
(include stdlib.h math.h) (include stdlib.h math.h)
;;; The C# folds these at compile time; written as divisions here they ;;; As the C# writes them. Its divisions are folded at compile time,
;;; would be unparenthesized macros and round differently in context. ;;; and C's are too, to the same doubles.
;; TODO sex#55: write the divisions, e.g. (/ -1.0 6.0), once define
;; bodies are translated and parenthesized.
(define STRETCH-2D -0.211324865405187) (define STRETCH-2D -0.211324865405187)
(define SQUISH-2D 0.366025403784439) (define SQUISH-2D 0.366025403784439)
(define STRETCH-3D -0.16666666666666666) (define STRETCH-3D (/ -1.0 6.0))
(define SQUISH-3D 0.3333333333333333) (define SQUISH-3D (/ 1.0 3.0))
(define NORM-2D 0.02127659574468085) (define NORM-2D (/ 1.0 47.0))
(define NORM-3D 0.009708737864077669) (define NORM-3D (/ 1.0 103.0))
(define NORM-2D-WARP 0.020435461373899677) (define NORM-2D-WARP 0.020435461373899677)
(pub define MAX-VALUE-3D 0.9871465422297019) (pub define MAX-VALUE-3D 0.9871465422297019)
(define VALUE-MULTIPLIER 1.2) (define VALUE-MULTIPLIER 1.2)