Loops/While: Difference between revisions

Content added Content deleted
Line 478: Line 478:
Use Round Towards -Inf to prevent the integer becoming a float.<br/>{{VI snippet}}<br/>
Use Round Towards -Inf to prevent the integer becoming a float.<br/>{{VI snippet}}<br/>
[[File:LabVIEW_Loops_While.png]]
[[File:LabVIEW_Loops_While.png]]

=={{header|Lang5}}==
{{trans|Factor}}
<lang lang5>: /i / int ; : 0= 0 == ;
: dip swap '_ set execute _ ; : dupd 'dup dip ;
: 2dip swap '_x set swap '_y set execute _y _x ;
: while
do dupd 'execute 2dip
rot 0= if break else dup 2dip then
loop ;

1024 "dup 0 >" "dup . 2 /i" while</lang>

=={{header|Liberty BASIC}}==
=={{header|Liberty BASIC}}==
All integers are changed to floats if an operation creates a non-integer result.
All integers are changed to floats if an operation creates a non-integer result.