aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/text/big-numbers.scm
blob: 2fb2a736211b596d5fb5d257ec204b8b94c3b22c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(define-module (test text-big-numbers)
  :use-module (srfi srfi-64)
  :use-module (srfi srfi-64 test-error)
  :use-module (text big-numbers))

(test-assert (power-of-10? #e1e100))
(test-assert (power-of-10? 1e100))
;; (test-assert (not (power-of-10? (+ #e1e100 1))))
;; (test-assert (not (power-of-10? (+ 1e100   1))))
;; (test-assert (not (power-of-10? (- #e1e100 1))))
;; (test-assert (not (power-of-10? (- 1e100   1))))

(test-equal "₉₆₈₀₂₃₇₄₅₁" (subscript 9680237451))
(test-equal "⁹⁶⁸⁰²³⁷⁴⁵¹" (supscript 9680237451))

(test-equal "10¹⁰⁰"
  (number->exponential-form #e1e100))

(test-error 'wrong-type-arg
  (number->exponential-form 20))

'((text big-numbers))