Sponsored Content
Top Forums Programming Some questions regarding old if.c Post 302930217 by orbit on Wednesday 31st of December 2014 02:19:26 PM
Old 12-31-2014
Some questions regarding old if.c

Hey Smilie
I have some questions regarding the old unix if command.
(see man pageman.cat-v.org/unix-6th/1/if

Here I uploaded the source code: (it's a bit too long, to put it here)
pastebin.com/bj0Hvfrw

Now my questions:

1.) Line 14: The function exp() is called with no arguments. But the function is declared as exp(s), so it needs an argument. Why is this working?


2.) What's happening there with exp() -> e1() -> e2() -> e3()... I think it's called recursive descent parsing, but I don't really get it. Could you help me a bit there.

Last edited by orbit; 01-02-2015 at 12:33 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

i got some questions :)

Hi! Im new to all this but the computer club im in has unix i think. now my questions. 1.is it NTFS i need to partion the harddrive with to be able to use unix? 2.Unix and Linux whats the diffrense?yes im a noob got no idea been using crap windows for ages and hate it. 3.I got a win98... (2 Replies)
Discussion started by: Pierre
2 Replies

2. Programming

C questions

What does "extern" do? ex. extern int x; and another question, what about using static in functions? like: static void foo(), why? (2 Replies)
Discussion started by: Esaia
2 Replies

3. Solaris

2 Questions

Hello Everbody I hope you can give me a hand, I have some questions The first one itīs about some message that I donīt know what means, I was looking about it. but nothing. This is the message rsh: connection from bad port bsd-gw: Error reading from connection: Bad file number And my... (4 Replies)
Discussion started by: lo-lp-kl
4 Replies

4. UNIX for Dummies Questions & Answers

Just a few questions.

Hi everyone im new to this forums, i just wanted to get started by asking a few question(Im a Unix newbie) 1. How do i sort a file called "dirr" in a ascending order on the 3rd column 2. what does alias on=who do Thanks in advance!!! (1 Reply)
Discussion started by: Da Paper
1 Replies

5. Programming

two questions

hey all, I have question when am writing simple shell... in the child am calling execvp, i want the parent to know when execvp returns - 1. how can i let the parent know the result of execvp thanks in advance (9 Replies)
Discussion started by: joey
9 Replies

6. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

7. UNIX for Dummies Questions & Answers

Just had a few questions

1) The lpr and sort utilities accept input either from a file named on the command line or from standard input. a)Name two other utilities that function in a similar manner. b)Name a utility that accepts its input only from standard input. 2) Explain the following error message. What... (10 Replies)
Discussion started by: youngyou
10 Replies

8. UNIX for Dummies Questions & Answers

Vi questions

Hello, I would like to know how we can highlight/select a section of a file in vi and delete that section if we don't want to use the dd command to delete one line at at time. There is one where we don't want to delete the whole line , but up to a certain word. (2 Replies)
Discussion started by: Pouchie1
2 Replies
FREXP(3)						     Linux Programmer's Manual							  FREXP(3)

NAME
frexp, frexpf, frexpl - convert floating-point number to fractional and integral components SYNOPSIS
#include <math.h> double frexp(double x, int *exp); float frexpf(float x, int *exp); long double frexpl(long double x, int *exp); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): frexpf(), frexpl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; or cc -std=c99 DESCRIPTION
The frexp() function is used to split the number x into a normalized fraction and an exponent which is stored in exp. RETURN VALUE
The frexp() function returns the normalized fraction. If the argument x is not zero, the normalized fraction is x times a power of two, and its absolute value is always in the range 1/2 (inclusive) to 1 (exclusive), that is, [0.5,1). If x is zero, then the normalized fraction is zero and zero is stored in exp. If x is a NaN, a NaN is returned, and the value of *exp is unspecified. If x is positive infinity (negative infinity), positive infinity (negative infinity) is returned, and the value of *exp is unspecified. ERRORS
No errors occur. CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4, 4.3BSD, C89. EXAMPLE
The program below produces results such as the following: $ ./a.out 2560 frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 $ ./a.out -4 frexp(-4, &e) = -0.5: -0.5 * 2^3 = -4 Program source #include <math.h> #include <float.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { double x, r; int exp; x = strtod(argv[1], NULL); r = frexp(x, &exp); printf("frexp(%g, &e) = %g: %g * %d^%d = %g ", x, r, r, FLT_RADIX, exp, x); exit(EXIT_SUCCESS); } SEE ALSO
ldexp(3), modf(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2010-09-20 FREXP(3)
All times are GMT -4. The time now is 02:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy