comparison doc/interpreter/numbers.txi @ 8828:8463d1a2e544

Doc fixes. * 2]$$. => 2].$$ * @var{extrapval} => @var{extrapval}. * call helloworld.oct => called @file{helloworld.oct} * @itemize => @table @code * shows. => shows: * save => @code{save} * @ref{Breakpoints} => @pxref{Breakpoints} * add @noindent following example * which is computed => and compute it * clarify wording * remove comma * good => well * set => number * by writing => with the command * has the option of directly calling => can call * [-like-] {+of the right size,+} * solvers => routines * handle => test for * add introductory section * add following * {+the+} [0..bitmax] => [0,bitmax] * of the => with * number => value * add usual * Besides when doing comparisons, logical => Logical {+also+} * array comparison => array, comparisons * param => parameter * works very similar => is similar * strings, => strings * most simple => simplest * easier => more easily * like => as * called => called, * clarify wording * you should simply type => use * clarify wording * means => way * equally => also * [-way much-] {+way+} * add with mean value parameter given by the first argument, @var{l} * add Functions described as @dfn{mapping functions} apply the given operation to each element when given a matrix argument. * in this brief introduction => here * It is worth noticing => Note * add following * means => ways
author Brian Gough <bjg@network-theory.co.uk>
date Fri, 20 Feb 2009 11:17:01 -0500
parents 0eb83938c8bc
children eb63fbe60fab
comparison
equal deleted inserted replaced
8827:55d999c23728 8828:8463d1a2e544
512 The arithmetic operations on integers are performed by casting the 512 The arithmetic operations on integers are performed by casting the
513 integer values to double precision values, performing the operation, and 513 integer values to double precision values, performing the operation, and
514 then re-casting the values back to the original integer type. As the 514 then re-casting the values back to the original integer type. As the
515 double precision type of Octave is only capable of representing integers 515 double precision type of Octave is only capable of representing integers
516 with up to 53 bits of precision, it is not possible to perform 516 with up to 53 bits of precision, it is not possible to perform
517 arithmetic of the 64 bit integer types. 517 arithmetic with 64 bit integer types.
518 518
519 When doing integer arithmetic one should consider the possibility of 519 When doing integer arithmetic one should consider the possibility of
520 underflow and overflow. This happens when the result of the computation 520 underflow and overflow. This happens when the result of the computation
521 can't be represented using the chosen integer type. As an example it is 521 can't be represented using the chosen integer type. As an example it is
522 not possible to represent the result of @math{10 - 20} when using 522 not possible to represent the result of @math{10 - 20} when using
564 functions of Octave are treated as integers. Therefore, even though the 564 functions of Octave are treated as integers. Therefore, even though the
565 example for @code{bitset} above passes the floating point value 565 example for @code{bitset} above passes the floating point value
566 @code{10}, it is treated as the bits @code{[1, 0, 1, 0]} rather than the 566 @code{10}, it is treated as the bits @code{[1, 0, 1, 0]} rather than the
567 bits of the native floating point format representation of @code{10}. 567 bits of the native floating point format representation of @code{10}.
568 568
569 As the maximum number that can be represented by a number is important 569 As the maximum value that can be represented by a number is important
570 for bit manipulation, particularly when forming masks, Octave supplies 570 for bit manipulation, particularly when forming masks, Octave supplies
571 the function @code{bitmax}. 571 the function @code{bitmax}.
572 572
573 @DOCSTRING(bitmax) 573 @DOCSTRING(bitmax)
574 574
620 the result will be a logical value whose value depends on whether or 620 the result will be a logical value whose value depends on whether or
621 not the comparison is true. 621 not the comparison is true.
622 622
623 The basic logical operations are @code{&}, @code{|}, and @code{!}, 623 The basic logical operations are @code{&}, @code{|}, and @code{!},
624 which correspond to ``Logical And'', ``Logical Or'', and ``Logical 624 which correspond to ``Logical And'', ``Logical Or'', and ``Logical
625 Negation''. These operations all follow the rules of logic. 625 Negation''. These operations all follow the usual rules of logic.
626 626
627 It is also possible to use logical values as part of standard numerical 627 It is also possible to use logical values as part of standard numerical
628 calculations. In this case @code{true} is converted to @code{1}, and 628 calculations. In this case @code{true} is converted to @code{1}, and
629 @code{false} to 0, both represented using double precision floating 629 @code{false} to 0, both represented using double precision floating
630 point numbers. So, the result of @code{true*22 - false/6} is @code{22}. 630 point numbers. So, the result of @code{true*22 - false/6} is @code{22}.
643 643
644 @noindent 644 @noindent
645 Instead of creating the @code{idx} array it is possible to replace 645 Instead of creating the @code{idx} array it is possible to replace
646 @code{data(idx)} with @code{data( data <= 2 )} in the above code. 646 @code{data(idx)} with @code{data( data <= 2 )} in the above code.
647 647
648 Besides when doing comparisons, logical values can be constructed by 648 Logical values can also be constructed by
649 casting numeric objects to logical values, or by using the @code{true} 649 casting numeric objects to logical values, or by using the @code{true}
650 or @code{false} functions. 650 or @code{false} functions.
651 651
652 @DOCSTRING(logical) 652 @DOCSTRING(logical)
653 653