Changeset 34438 in project


Ignore:
Timestamp:
08/28/17 03:00:46 (4 weeks ago)
Author:
kon
Message:

mv

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/mathh

    r34437 r34438  
    160160; negative-zero :
    161161; unclassified :
     162
     163
     164=== Flonum Utilities
     165
     166==== Usage
     167
     168<enscript language=scheme>
     169(require-extension fp-utils)
     170</enscript>
     171
     172{{N N1 ... X1 ... Y1 ...}} below are {{flonum}}.
     173
     174{{P}} is the precision in decimal digits, an {{integer}}.
     175
     176==== fprandom
     177
     178<procedure>(fprandom [N]) => flonum</procedure>
     179
     180{{N}} {{fixnum}} limit.
     181
     182==== fpzero?
     183
     184<procedure>(fpzero? N) => boolean</procedure>
     185
     186==== fppositive?
     187
     188<procedure>(fppositive? N) => boolean</procedure>
     189
     190==== fpcardinal?
     191
     192<procedure>(fpcardinal? N) => boolean</procedure>
     193
     194==== fpnegative?
     195
     196<procedure>(fpnegative? N) => boolean</procedure>
     197
     198==== fpeven?
     199
     200<procedure>(fpeven? N) => boolean</procedure>
     201
     202==== fpodd?
     203
     204<procedure>(fpodd? N) => boolean</procedure>
     205
     206==== fpclosed-right?
     207==== fpclosedr?
     208
     209<procedure>(fpclosed-right? L N H) => boolean</procedure>
     210<procedure>(fpclosedr? L N H) => boolean</procedure>
     211
     212Returns {{N}} in {{(L .. H]}}.
     213
     214{{N}}, {{L}} & {{H}} are {{flonum}} low & high limits.
     215
     216==== fpclosed?
     217
     218Returns {{N}} in {{[L .. H]}}.
     219
     220<procedure>(fpclosed? L N H) => boolean</procedure>
     221
     222{{N}}, {{L}} & {{H}} are {{flonum}} low & high limits.
     223
     224==== fpclosed-left?
     225==== fpclosedl?
     226
     227Returns {{N}} in {{[L .. H)}}.
     228
     229<procedure>(fpclosed-left? L N H) => boolean</procedure>
     230<procedure>(fpclosedl? L N H) => boolean</procedure>
     231
     232{{N}}, {{L}} & {{H}} are {{flonum}} low & high limits.
     233
     234==== fpadd1
     235
     236<procedure>(fpadd1 N) => flonum</procedure>
     237
     238==== fpsub1
     239
     240<procedure>(fpsub1 N) => flonum</procedure>
     241
     242==== fpmodulo
     243
     244<procedure>(fpmodulo N1 N2) => flonum</procedure>
     245
     246==== fpquotient
     247
     248<procedure>(fpquotient N1 N2) => flonum</procedure>
     249
     250==== fpremainder
     251
     252<procedure>(fpremainder N1 N2) => flonum</procedure>
     253
     254==== fpfraction
     255
     256<procedure>(fpfraction N) => flonum</procedure>
     257
     258==== fptruncate/precision
     259
     260<procedure>(fptruncate/precision N [P 4]) => flonum</procedure>
     261
     262==== fpround/precision
     263
     264<procedure>(fpround/precision N [P 4]) => flonum</procedure>
     265
     266==== fpceiling/precision
     267
     268<procedure>(fpceiling/precision N [P 4]) => flonum</procedure>
     269
     270==== fpfloor/precision
     271
     272<procedure>(fpfloor/precision N [P 4]) => flonum</procedure>
     273
     274==== fp~=
     275
     276<procedure>(fp~= N1 N2 [EPS flonum-epsilon]) => flonum</procedure>
     277
     278Compare floating-point values {{N1}} and {{N2}} within some {{flonum}} epsilon
     279{{EPS}}.
     280
     281==== fp~<=
     282
     283<procedure>(fp~<= N) => boolean</procedure>
     284
     285==== fp~>=
     286
     287<procedure>(fp~>= N) => boolean</procedure>
     288
     289==== fpsqr
     290
     291<procedure>(fpsqr N) => flonum</procedure>
     292
     293==== fpcub
     294
     295<procedure>(fpcub N) => flonum</procedure>
     296
     297==== fpdegree->radian
     298
     299<procedure>(fpdegree->radian N) => flonum</procedure>
     300
     301==== fpradian->degree
     302
     303<procedure>(fpradian->degree N) => flonum</procedure>
     304
     305==== fpdistance
     306
     307<procedure>(fpdistance X1 Y1 X2 Y2) => flonum</procedure>
     308
     309Pythagorean distance between the points {{X1 Y1}} and {{X2 Y2}}.
     310
     311==== fpdistance*
     312
     313<procedure>(fpdistance* X1 Y1 X2 Y2) => flonum</procedure>
     314
     315Pythagorean distance, inaccurate but useful for relative comparisons.
     316
     317==== fpmax-and-min
     318
     319<procedure>(fpmax-and-min N ...) => (values flonum flonum)</procedure>
     320
     321Returns the maximum & minimum values for the {{flonum}}s {{N ...}}.
     322
     323==== fpprecision-factor
     324
     325<procedure>(fpprecision-factor P [BASE 10.0]) => flonum</procedure>
     326
     327Returns factor for {{P}} decimal digits precision.
     328
     329
     330=== Fixnum Utilities
     331
     332==== Usage
     333
     334<enscript language=scheme>
     335(require-extension fx-utils)
     336</enscript>
     337
     338{{N N1 ... X1 ... Y1 ...}} below are {{fixnum}}.
     339
     340==== fxrandom
     341
     342<procedure>(fxrandom [N]) => fixnum</procedure>
     343
     344{{N}} {{fixnum}} limit.
     345
     346==== fxzero?
     347
     348<procedure>(fxzero? N) => boolean</procedure>
     349
     350==== fxpositive?
     351
     352<procedure>(fxpositive? N) => boolean</procedure>
     353
     354==== fxcardinal?
     355
     356<procedure>(fxcardinal? N) => boolean</procedure>
     357
     358==== fxnegative?
     359
     360<procedure>(fxnegative? N) => boolean</procedure>
     361
     362==== fxclosed-right?
     363==== fxclosedr?
     364
     365<procedure>(fxclosed-right? L N H) => boolean</procedure>
     366<procedure>(fxclosedr? L N H) => boolean</procedure>
     367
     368Returns {{N}} in {{(L .. H]}}.
     369
     370{{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits.
     371
     372==== fxclosed?
     373
     374Returns {{N}} in {{[L .. H]}}.
     375
     376<procedure>(fxclosed? L N H) => boolean</procedure>
     377
     378{{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits.
     379
     380==== fxclosed-left?
     381==== fxclosedl?
     382
     383Returns {{N}} in {{[L .. H)}}.
     384
     385<procedure>(fxclosed-left? L N H) => boolean</procedure>
     386<procedure>(fxclosedl? L N H) => boolean</procedure>
     387
     388{{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits.
     389
     390==== fxadd1
     391
     392<procedure>(fxadd1 N) => fixnum</procedure>
     393
     394==== fxsub1
     395
     396<procedure>(fxsub1 N) => fixnum</procedure>
     397
     398==== fxabs
     399
     400<procedure>(fxabs N) => fixnum</procedure>
     401
     402==== fxsqr
     403
     404<procedure>(fxsqr N) => fixnum</procedure>
     405
     406==== fxcub
     407
     408<procedure>(fxcub N) => fixnum</procedure>
     409
     410==== fxpow2log2
     411
     412<procedure>(fxpow2log2 N) => fixnum</procedure>
     413
     414Returns {{fixnum}} {{2^N}}.
     415
     416==== fxdistance
     417
     418<procedure>(fxdistance X1 Y1 X2 Y2) => fixnum</procedure>
     419
     420Pythagorean distance between the points {{X1 Y1}} and {{X2 Y2}}.
     421
     422==== fxdistance*
     423
     424<procedure>(fxdistance* X1 Y1 X2 Y2) => fixnum</procedure>
     425
     426Pythagorean distance, inaccurate but useful for relative comparisons.
     427
     428==== fxmax-and-min
     429
     430<procedure>(fxmax-and-min N ...) => (values fixnum fixnum)</procedure>
     431
     432Returns the maximum & minimum values for the {{fixnum}}s {{N ...}}.
    162433
    163434
     
    216487
    217488
    218 === Flonum Utilities
    219 
    220 ==== Usage
    221 
    222 <enscript language=scheme>
    223 (require-extension fp-utils)
    224 </enscript>
    225 
    226 {{N N1 ... X1 ... Y1 ...}} below are {{flonum}}.
    227 
    228 {{P}} is the precision in decimal digits, an {{integer}}.
    229 
    230 ==== fprandom
    231 
    232 <procedure>(fprandom [N]) => flonum</procedure>
    233 
    234 {{N}} {{fixnum}} limit.
    235 
    236 ==== fpzero?
    237 
    238 <procedure>(fpzero? N) => boolean</procedure>
    239 
    240 ==== fppositive?
    241 
    242 <procedure>(fppositive? N) => boolean</procedure>
    243 
    244 ==== fpcardinal?
    245 
    246 <procedure>(fpcardinal? N) => boolean</procedure>
    247 
    248 ==== fpnegative?
    249 
    250 <procedure>(fpnegative? N) => boolean</procedure>
    251 
    252 ==== fpeven?
    253 
    254 <procedure>(fpeven? N) => boolean</procedure>
    255 
    256 ==== fpodd?
    257 
    258 <procedure>(fpodd? N) => boolean</procedure>
    259 
    260 ==== fpclosed-right?
    261 ==== fpclosedr?
    262 
    263 <procedure>(fpclosed-right? L N H) => boolean</procedure>
    264 <procedure>(fpclosedr? L N H) => boolean</procedure>
    265 
    266 Returns {{N}} in {{(L .. H]}}.
    267 
    268 {{N}}, {{L}} & {{H}} are {{flonum}} low & high limits.
    269 
    270 ==== fpclosed?
    271 
    272 Returns {{N}} in {{[L .. H]}}.
    273 
    274 <procedure>(fpclosed? L N H) => boolean</procedure>
    275 
    276 {{N}}, {{L}} & {{H}} are {{flonum}} low & high limits.
    277 
    278 ==== fpclosed-left?
    279 ==== fpclosedl?
    280 
    281 Returns {{N}} in {{[L .. H)}}.
    282 
    283 <procedure>(fpclosed-left? L N H) => boolean</procedure>
    284 <procedure>(fpclosedl? L N H) => boolean</procedure>
    285 
    286 {{N}}, {{L}} & {{H}} are {{flonum}} low & high limits.
    287 
    288 ==== fpadd1
    289 
    290 <procedure>(fpadd1 N) => flonum</procedure>
    291 
    292 ==== fpsub1
    293 
    294 <procedure>(fpsub1 N) => flonum</procedure>
    295 
    296 ==== fpmodulo
    297 
    298 <procedure>(fpmodulo N1 N2) => flonum</procedure>
    299 
    300 ==== fpquotient
    301 
    302 <procedure>(fpquotient N1 N2) => flonum</procedure>
    303 
    304 ==== fpremainder
    305 
    306 <procedure>(fpremainder N1 N2) => flonum</procedure>
    307 
    308 ==== fpfraction
    309 
    310 <procedure>(fpfraction N) => flonum</procedure>
    311 
    312 ==== fptruncate/precision
    313 
    314 <procedure>(fptruncate/precision N [P 4]) => flonum</procedure>
    315 
    316 ==== fpround/precision
    317 
    318 <procedure>(fpround/precision N [P 4]) => flonum</procedure>
    319 
    320 ==== fpceiling/precision
    321 
    322 <procedure>(fpceiling/precision N [P 4]) => flonum</procedure>
    323 
    324 ==== fpfloor/precision
    325 
    326 <procedure>(fpfloor/precision N [P 4]) => flonum</procedure>
    327 
    328 ==== fp~=
    329 
    330 <procedure>(fp~= N1 N2 [EPS flonum-epsilon]) => flonum</procedure>
    331 
    332 Compare floating-point values {{N1}} and {{N2}} within some {{flonum}} epsilon
    333 {{EPS}}.
    334 
    335 ==== fp~<=
    336 
    337 <procedure>(fp~<= N) => boolean</procedure>
    338 
    339 ==== fp~>=
    340 
    341 <procedure>(fp~>= N) => boolean</procedure>
    342 
    343 ==== fpsqr
    344 
    345 <procedure>(fpsqr N) => flonum</procedure>
    346 
    347 ==== fpcub
    348 
    349 <procedure>(fpcub N) => flonum</procedure>
    350 
    351 ==== fpdegree->radian
    352 
    353 <procedure>(fpdegree->radian N) => flonum</procedure>
    354 
    355 ==== fpradian->degree
    356 
    357 <procedure>(fpradian->degree N) => flonum</procedure>
    358 
    359 ==== fpdistance
    360 
    361 <procedure>(fpdistance X1 Y1 X2 Y2) => flonum</procedure>
    362 
    363 Pythagorean distance between the points {{X1 Y1}} and {{X2 Y2}}.
    364 
    365 ==== fpdistance*
    366 
    367 <procedure>(fpdistance* X1 Y1 X2 Y2) => flonum</procedure>
    368 
    369 Pythagorean distance, inaccurate but useful for relative comparisons.
    370 
    371 ==== fpmax-and-min
    372 
    373 <procedure>(fpmax-and-min N ...) => (values flonum flonum)</procedure>
    374 
    375 Returns the maximum & minimum values for the {{flonum}}s {{N ...}}.
    376 
    377 ==== fpprecision-factor
    378 
    379 <procedure>(fpprecision-factor P [BASE 10.0]) => flonum</procedure>
    380 
    381 Returns factor for {{P}} decimal digits precision.
    382 
    383 
    384 === Fixnum Utilities
    385 
    386 ==== Usage
    387 
    388 <enscript language=scheme>
    389 (require-extension fx-utils)
    390 </enscript>
    391 
    392 {{N N1 ... X1 ... Y1 ...}} below are {{fixnum}}.
    393 
    394 ==== fxrandom
    395 
    396 <procedure>(fxrandom [N]) => fixnum</procedure>
    397 
    398 {{N}} {{fixnum}} limit.
    399 
    400 ==== fxzero?
    401 
    402 <procedure>(fxzero? N) => boolean</procedure>
    403 
    404 ==== fxpositive?
    405 
    406 <procedure>(fxpositive? N) => boolean</procedure>
    407 
    408 ==== fxcardinal?
    409 
    410 <procedure>(fxcardinal? N) => boolean</procedure>
    411 
    412 ==== fxnegative?
    413 
    414 <procedure>(fxnegative? N) => boolean</procedure>
    415 
    416 ==== fxclosed-right?
    417 ==== fxclosedr?
    418 
    419 <procedure>(fxclosed-right? L N H) => boolean</procedure>
    420 <procedure>(fxclosedr? L N H) => boolean</procedure>
    421 
    422 Returns {{N}} in {{(L .. H]}}.
    423 
    424 {{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits.
    425 
    426 ==== fxclosed?
    427 
    428 Returns {{N}} in {{[L .. H]}}.
    429 
    430 <procedure>(fxclosed? L N H) => boolean</procedure>
    431 
    432 {{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits.
    433 
    434 ==== fxclosed-left?
    435 ==== fxclosedl?
    436 
    437 Returns {{N}} in {{[L .. H)}}.
    438 
    439 <procedure>(fxclosed-left? L N H) => boolean</procedure>
    440 <procedure>(fxclosedl? L N H) => boolean</procedure>
    441 
    442 {{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits.
    443 
    444 ==== fxadd1
    445 
    446 <procedure>(fxadd1 N) => fixnum</procedure>
    447 
    448 ==== fxsub1
    449 
    450 <procedure>(fxsub1 N) => fixnum</procedure>
    451 
    452 ==== fxabs
    453 
    454 <procedure>(fxabs N) => fixnum</procedure>
    455 
    456 ==== fxsqr
    457 
    458 <procedure>(fxsqr N) => fixnum</procedure>
    459 
    460 ==== fxcub
    461 
    462 <procedure>(fxcub N) => fixnum</procedure>
    463 
    464 ==== fxpow2log2
    465 
    466 <procedure>(fxpow2log2 N) => fixnum</procedure>
    467 
    468 Returns {{fixnum}} {{2^N}}.
    469 
    470 ==== fxdistance
    471 
    472 <procedure>(fxdistance X1 Y1 X2 Y2) => fixnum</procedure>
    473 
    474 Pythagorean distance between the points {{X1 Y1}} and {{X2 Y2}}.
    475 
    476 ==== fxdistance*
    477 
    478 <procedure>(fxdistance* X1 Y1 X2 Y2) => fixnum</procedure>
    479 
    480 Pythagorean distance, inaccurate but useful for relative comparisons.
    481 
    482 ==== fxmax-and-min
    483 
    484 <procedure>(fxmax-and-min N ...) => (values fixnum fixnum)</procedure>
    485 
    486 Returns the maximum & minimum values for the {{fixnum}}s {{N ...}}.
    487 
    488 
    489489=== Math Constants (Include)
    490490
Note: See TracChangeset for help on using the changeset viewer.