GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MOO(1) FreeBSD General Commands Manual MOO(1)

moo
Marco's Object Oriented calculator

moo [
-lsu
] [
-b base
] [
expr
] [
...
]

A simple calculator that accepts C-like syntax as input. Calculations are done on expr, if given. Otherwise, the standard input is used.
Numbers can be entered in hexadecimal (0xbeef), decimal (1984), octal (007), and binary (0b1001). All numerical operators (+, -, *, /, %), bit operators (|, ^, &, ~, <<, >>), and logical operators (==, !=, <, >, <=, >=, !, &&, ||) are supported.
Output will be in the same bases as the input, unless a different base was specified (see -b flag below). If only one number is input, the result is printed in all bases.
The options are:
base
Output numbers in base format. base can be 2, 8, 10, 16, or `all'. Multiple bases may be specified by giving the -b flag multiple times.
Output bit labels for binary results.
Output base 10 numbers as signed.
Output base 10 numbers as unsigned.

bc(1), dc(1), expr(1)

moo was written for the public domain by Ray Lai ⟨ray@cyth.net⟩ after much whining by Marco Peereboom.

Integer overflows are not checked. Marco says, ``I don't think you should call the integer overflows a bug but a feature. You can use it to test signed unsigned issues.''

Calculations are limited to the size of a 64-bit integer.
Like bc(1), moo parses ``3--2'' without error.
June 4, 2016 FreeBSD 12.0-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.