Changeset 34438 in project
 Timestamp:
 08/28/17 03:00:46 (3 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

wiki/eggref/4/mathh
r34437 r34438 160 160 ; negativezero : 161 161 ; unclassified : 162 163 164 === Flonum Utilities 165 166 ==== Usage 167 168 <enscript language=scheme> 169 (requireextension fputils) 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 ==== fpclosedright? 207 ==== fpclosedr? 208 209 <procedure>(fpclosedright? L N H) => boolean</procedure> 210 <procedure>(fpclosedr? L N H) => boolean</procedure> 211 212 Returns {{N}} in {{(L .. H]}}. 213 214 {{N}}, {{L}} & {{H}} are {{flonum}} low & high limits. 215 216 ==== fpclosed? 217 218 Returns {{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 ==== fpclosedleft? 225 ==== fpclosedl? 226 227 Returns {{N}} in {{[L .. H)}}. 228 229 <procedure>(fpclosedleft? 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 flonumepsilon]) => flonum</procedure> 277 278 Compare floatingpoint 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 309 Pythagorean distance between the points {{X1 Y1}} and {{X2 Y2}}. 310 311 ==== fpdistance* 312 313 <procedure>(fpdistance* X1 Y1 X2 Y2) => flonum</procedure> 314 315 Pythagorean distance, inaccurate but useful for relative comparisons. 316 317 ==== fpmaxandmin 318 319 <procedure>(fpmaxandmin N ...) => (values flonum flonum)</procedure> 320 321 Returns the maximum & minimum values for the {{flonum}}s {{N ...}}. 322 323 ==== fpprecisionfactor 324 325 <procedure>(fpprecisionfactor P [BASE 10.0]) => flonum</procedure> 326 327 Returns factor for {{P}} decimal digits precision. 328 329 330 === Fixnum Utilities 331 332 ==== Usage 333 334 <enscript language=scheme> 335 (requireextension fxutils) 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 ==== fxclosedright? 363 ==== fxclosedr? 364 365 <procedure>(fxclosedright? L N H) => boolean</procedure> 366 <procedure>(fxclosedr? L N H) => boolean</procedure> 367 368 Returns {{N}} in {{(L .. H]}}. 369 370 {{N}}, {{L}} & {{H}} are {{fixnum}} low & high limits. 371 372 ==== fxclosed? 373 374 Returns {{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 ==== fxclosedleft? 381 ==== fxclosedl? 382 383 Returns {{N}} in {{[L .. H)}}. 384 385 <procedure>(fxclosedleft? 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 414 Returns {{fixnum}} {{2^N}}. 415 416 ==== fxdistance 417 418 <procedure>(fxdistance X1 Y1 X2 Y2) => fixnum</procedure> 419 420 Pythagorean distance between the points {{X1 Y1}} and {{X2 Y2}}. 421 422 ==== fxdistance* 423 424 <procedure>(fxdistance* X1 Y1 X2 Y2) => fixnum</procedure> 425 426 Pythagorean distance, inaccurate but useful for relative comparisons. 427 428 ==== fxmaxandmin 429 430 <procedure>(fxmaxandmin N ...) => (values fixnum fixnum)</procedure> 431 432 Returns the maximum & minimum values for the {{fixnum}}s {{N ...}}. 162 433 163 434 … … 216 487 217 488 218 === Flonum Utilities219 220 ==== Usage221 222 <enscript language=scheme>223 (requireextension fputils)224 </enscript>225 226 {{N N1 ... X1 ... Y1 ...}} below are {{flonum}}.227 228 {{P}} is the precision in decimal digits, an {{integer}}.229 230 ==== fprandom231 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 ==== fpclosedright?261 ==== fpclosedr?262 263 <procedure>(fpclosedright? 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 ==== fpclosedleft?279 ==== fpclosedl?280 281 Returns {{N}} in {{[L .. H)}}.282 283 <procedure>(fpclosedleft? 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 ==== fpadd1289 290 <procedure>(fpadd1 N) => flonum</procedure>291 292 ==== fpsub1293 294 <procedure>(fpsub1 N) => flonum</procedure>295 296 ==== fpmodulo297 298 <procedure>(fpmodulo N1 N2) => flonum</procedure>299 300 ==== fpquotient301 302 <procedure>(fpquotient N1 N2) => flonum</procedure>303 304 ==== fpremainder305 306 <procedure>(fpremainder N1 N2) => flonum</procedure>307 308 ==== fpfraction309 310 <procedure>(fpfraction N) => flonum</procedure>311 312 ==== fptruncate/precision313 314 <procedure>(fptruncate/precision N [P 4]) => flonum</procedure>315 316 ==== fpround/precision317 318 <procedure>(fpround/precision N [P 4]) => flonum</procedure>319 320 ==== fpceiling/precision321 322 <procedure>(fpceiling/precision N [P 4]) => flonum</procedure>323 324 ==== fpfloor/precision325 326 <procedure>(fpfloor/precision N [P 4]) => flonum</procedure>327 328 ==== fp~=329 330 <procedure>(fp~= N1 N2 [EPS flonumepsilon]) => flonum</procedure>331 332 Compare floatingpoint values {{N1}} and {{N2}} within some {{flonum}} epsilon333 {{EPS}}.334 335 ==== fp~<=336 337 <procedure>(fp~<= N) => boolean</procedure>338 339 ==== fp~>=340 341 <procedure>(fp~>= N) => boolean</procedure>342 343 ==== fpsqr344 345 <procedure>(fpsqr N) => flonum</procedure>346 347 ==== fpcub348 349 <procedure>(fpcub N) => flonum</procedure>350 351 ==== fpdegree>radian352 353 <procedure>(fpdegree>radian N) => flonum</procedure>354 355 ==== fpradian>degree356 357 <procedure>(fpradian>degree N) => flonum</procedure>358 359 ==== fpdistance360 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 ==== fpmaxandmin372 373 <procedure>(fpmaxandmin N ...) => (values flonum flonum)</procedure>374 375 Returns the maximum & minimum values for the {{flonum}}s {{N ...}}.376 377 ==== fpprecisionfactor378 379 <procedure>(fpprecisionfactor P [BASE 10.0]) => flonum</procedure>380 381 Returns factor for {{P}} decimal digits precision.382 383 384 === Fixnum Utilities385 386 ==== Usage387 388 <enscript language=scheme>389 (requireextension fxutils)390 </enscript>391 392 {{N N1 ... X1 ... Y1 ...}} below are {{fixnum}}.393 394 ==== fxrandom395 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 ==== fxclosedright?417 ==== fxclosedr?418 419 <procedure>(fxclosedright? 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 ==== fxclosedleft?435 ==== fxclosedl?436 437 Returns {{N}} in {{[L .. H)}}.438 439 <procedure>(fxclosedleft? 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 ==== fxadd1445 446 <procedure>(fxadd1 N) => fixnum</procedure>447 448 ==== fxsub1449 450 <procedure>(fxsub1 N) => fixnum</procedure>451 452 ==== fxabs453 454 <procedure>(fxabs N) => fixnum</procedure>455 456 ==== fxsqr457 458 <procedure>(fxsqr N) => fixnum</procedure>459 460 ==== fxcub461 462 <procedure>(fxcub N) => fixnum</procedure>463 464 ==== fxpow2log2465 466 <procedure>(fxpow2log2 N) => fixnum</procedure>467 468 Returns {{fixnum}} {{2^N}}.469 470 ==== fxdistance471 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 ==== fxmaxandmin483 484 <procedure>(fxmaxandmin N ...) => (values fixnum fixnum)</procedure>485 486 Returns the maximum & minimum values for the {{fixnum}}s {{N ...}}.487 488 489 489 === Math Constants (Include) 490 490
Note: See TracChangeset
for help on using the changeset viewer.