Sponsored Content
Full Discussion: mysterious #define
Top Forums Programming mysterious #define Post 302118997 by frequency8 on Friday 25th of May 2007 10:43:40 PM
Old 05-25-2007
That response reminds me of the day I decided I wasn't cut out to be a Math Major. In my Linear Algebra class, my Professor said "There is something in the vector space. That something is nothingness."

Okay, so now, let me get this right.

When I go
#define SOMETHING

Something is being defined, but we aren't too sure what that something is? And then later on, when I see

#ifdef JOB_CONTROL
signal(SIGTSTP,(RETSIGTYPE (*)())susp);
#endif /*JOB_CONTROL*/

We can use that something, which aren't too sure of what it is, to test to see if the shell supports job control?
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Mysterious Server Shutdown

Virtually no UNIX admin experience. Any admin duties are shared by several folks with no special training. Today we had our Sun v880 server, running Solaris 5.8, shutdown for no apparent reason. When we checked on server we found it completely powered down, yet still connected to a fully... (6 Replies)
Discussion started by: buechler66
6 Replies

2. UNIX for Dummies Questions & Answers

#define in perl

Hi friends, I am not sure if perl questions can be raised here. :rolleyes: But I have a doubt if there is a way to do "#define" in perl, like in C. Does anyone know if it is feasible (without CPAN modules)? Thanks, Srini (7 Replies)
Discussion started by: srinivasan_85
7 Replies

3. Programming

mysterious execution failure and core dump generation

Posting again, as previous query had a typo. ======================================================= Hi, I am running a c++ program in unix AIX machine. There are two functions in a file which are being used by a third function in the same file. the two functions being used are of the same type.... (1 Reply)
Discussion started by: suresh_kb211
1 Replies

4. Programming

#define

Hello, I would like to conditionaly comment in my code source some fields from arrays. So I use the property ## from the #define definition. my code: ... #define slet /##* #define etsl *##/ ... const T_SVT_ADLL_A653_DESC A_DESC = { { slet qwerty etsl SLICING,... (3 Replies)
Discussion started by: cypleen
3 Replies

5. Programming

help with #define in C

if i do this in C #define NUM 1234512345 then how come i cant print it out using int main(int argc, char **argv) { printf("%d\n", NUM); return 0; } well the result is -1219236538, why isnt it 1234512345 ? (7 Replies)
Discussion started by: omega666
7 Replies

6. Programming

#define in c

Hi, I had a head file, looks like #define MIN_NUM 10 #define MAX_NUM 10 is there any way to get "MAX_NUM" from 10? thanks. peter (9 Replies)
Discussion started by: laopi
9 Replies

7. Shell Programming and Scripting

Debugging mysterious perl script problem

the attached perl script is a deamon that, once kicked off from the command line, it runs in the background and waits for the master server to tell it what plugins to run. the script works well. but the problem is, whenever i start it, after about a few seconds of starting it, i start getting... (4 Replies)
Discussion started by: SkySmart
4 Replies
Math::BigRat(3pm)					 Perl Programmers Reference Guide					 Math::BigRat(3pm)

NAME
Math::BigRat - arbitrarily big rationales SYNOPSIS
use Math::BigRat; $x = Math::BigRat->new('3/7'); $x += '5/9'; print $x->bstr()," "; print $x ** 2," "; DESCRIPTION
Math::BigRat complements Math::BigInt and Math::BigFloat by providing support for arbitrarily big rationales. MATH LIBRARY Math with the numbers is done (by default) by a module called Math::BigInt::Calc. This is equivalent to saying: use Math::BigRat lib => 'Calc'; You can change this by using: use Math::BigRat lib => 'BitVect'; The following would first try to find Math::BigInt::Foo, then Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc: use Math::BigRat lib => 'Foo,Math::BigInt::Bar'; Calc.pm uses as internal format an array of elements of some decimal base (usually 1e7, but this might be different for some systems) with the least significant digit first, while BitVect.pm uses a bit vector of base 2, most significant bit first. Other modules might use even different means of representing the numbers. See the respective module documentation for further details. Currently the following replacement libraries exist, search for them at CPAN: Math::BigInt::BitVect Math::BigInt::GMP Math::BigInt::Pari Math::BigInt::FastCalc METHODS
Any methods not listed here are dervied from Math::BigFloat (or Math::BigInt), so make sure you check these two modules for further infor- mation. new() $x = Math::BigRat->new('1/3'); Create a new Math::BigRat object. Input can come in various forms: $x = Math::BigRat->new(123); # scalars $x = Math::BigRat->new('123.3'); # float $x = Math::BigRat->new('1/3'); # simple string $x = Math::BigRat->new('1 / 3'); # spaced $x = Math::BigRat->new('1 / 0.1'); # w/ floats $x = Math::BigRat->new(Math::BigInt->new(3)); # BigInt $x = Math::BigRat->new(Math::BigFloat->new('3.1')); # BigFloat $x = Math::BigRat->new(Math::BigInt::Lite->new('2')); # BigLite numerator() $n = $x->numerator(); Returns a copy of the numerator (the part above the line) as signed BigInt. denominator() $d = $x->denominator(); Returns a copy of the denominator (the part under the line) as positive BigInt. parts() ($n,$d) = $x->parts(); Return a list consisting of (signed) numerator and (unsigned) denominator as BigInts. as_number() $x = Math::BigRat->new('13/7'); print $x->as_number()," "; # '1' Returns a copy of the object as BigInt by truncating it to integer. bfac() $x->bfac(); Calculates the factorial of $x. For instance: print Math::BigRat->new('3/1')->bfac()," "; # 1*2*3 print Math::BigRat->new('5/1')->bfac()," "; # 1*2*3*4*5 Works currently only for integers. blog() Is not yet implemented. bround()/round()/bfround() Are not yet implemented. is_one() print "$x is 1 " if $x->is_one(); Return true if $x is exactly one, otherwise false. is_zero() print "$x is 0 " if $x->is_zero(); Return true if $x is exactly zero, otherwise false. is_positive() print "$x is >= 0 " if $x->is_positive(); Return true if $x is positive (greater than or equal to zero), otherwise false. Please note that '+inf' is also positive, while 'NaN' and '-inf' aren't. is_negative() print "$x is < 0 " if $x->is_negative(); Return true if $x is negative (smaller than zero), otherwise false. Please note that '-inf' is also negative, while 'NaN' and '+inf' aren't. is_int() print "$x is an integer " if $x->is_int(); Return true if $x has a denominator of 1 (e.g. no fraction parts), otherwise false. Please note that '-inf', 'inf' and 'NaN' aren't inte- ger. is_odd() print "$x is odd " if $x->is_odd(); Return true if $x is odd, otherwise false. is_even() print "$x is even " if $x->is_even(); Return true if $x is even, otherwise false. bceil() $x->bceil(); Set $x to the next bigger integer value (e.g. truncate the number to integer and then increment it by one). bfloor() $x->bfloor(); Truncate $x to an integer value. BUGS
Some things are not yet implemented, or only implemented half-way: inf handling (partial) NaN handling (partial) rounding (not implemented except for bceil/bfloor) $x ** $y where $y is not an integer LICENSE
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Math::BigFloat and Math::Big as well as Math::BigInt::BitVect, Math::BigInt::Pari and Math::BigInt::GMP. See <http://search.cpan.org/search?dist=bignum> for a way to use Math::BigRat. The package at <http://search.cpan.org/search?dist=Math%3A%3ABigRat> may contain more documentation and examples as well as testcases. AUTHORS
(C) by Tels <http://bloodgate.com/> 2001-2002. perl v5.8.0 2002-06-01 Math::BigRat(3pm)
All times are GMT -4. The time now is 08:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy