<blocksapp="Snap! 7, https://snap.berkeley.edu"version="2"><block-definitions="USE BIGNUMS %'bool'"type="command"category="operators"><commentw="303.3333333333333"collapsed="false">call with True to turn on the entire Scheme numeric tower, including infinite-precision integers, exact rationals, and complex numbers; call with False to restore native JavaScript arithmetic.</comment><header></header><code></code><translations>pt:altera utilização de aritmética do Scheme para _
ca:sistema numèric d'Scheme _
</translations><inputs><inputtype="%b"></input></inputs><script><blocks="doApplyExtension"><l>src_load(url)</l><list><l>libraries/biginteger.js</l></list></block><blocks="doApplyExtension"><l>src_load(url)</l><list><l>libraries/schemeNumber.js</l></list></block><blocks="doApplyExtension"><l>src_load(url)</l><list><l>libraries/bignums.js</l></list></block><blocks="doApplyExtension"><l>big_switch(bool)</l><list><blockvar="bool"/></list></block></script></block-definition><block-definitions="%'n' !"type="reporter"category="operators"><commentx="0"y="0"w="190.66666666666666"collapsed="false">The factorial function, to make very large numbers, to demo bignums.</comment><header></header><code></code><translations></translations><inputs><inputtype="%n"></input></inputs><script><blocks="doReport"><blocks="reportIfElse"><blocks="reportEquals"><blockvar="n"/><l>0</l></block><l>1</l><blocks="reportProduct"><blockvar="n"/><custom-blocks="%n !"><blocks="reportDifference"><blockvar="n"/><l>1</l></block></custom-block></block></block></block></script></block-definition><block-definitions="%'x'"type="reporter"category="operators"><commentx="0"y="0"w="234.66666666666666"collapsed="false">The identity function: reports its input.
It's useful to get things like 3/4 or 5-2i into
numeric input slots.</comment><header></header><code></code><translations></translations><inputs><inputtype="%s"></input></inputs><script><blocks="doReport"><blockvar="x"/></block></script></block-definition><block-definitions="Scheme number %'function' of %'number'"type="reporter"category="operators"><commentw="300"collapsed="true">Provides Scheme arithmetic functions not in JavaScript</comment><header></header><code></code><translations>pt:_ de _
ca:Scheme _ de _
</translations><inputs><inputtype="%s"readonly="true"><options>number?
complex?
real?
rational?
integer?
exact?
inexact?
exact
inexact
finite?
infinite?
nan?
numerator
denominator
real-part
imag-part
magnitude
angle</options></input><inputtype="%s"></input></inputs><script><blocks="doReport"><blocks="reportApplyExtension"><l>big_scheme(fn, num)</l><list><blockvar="function"/><blockvar="number"/></list></block></block></script></block-definition></blocks>