Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

seg faults

Name: Anonymous 2012-04-26 23:25

Sorry for being that guy but I'm seg faulting like it's my day job.

Specifically on the functions power and the sine and cosine.


pastebin.com/FnikC9fC

Name: Anonymous 2012-04-27 1:20

The only thing I can think of is your data types for things like invEpsilon/Epsilon/temp/temp1 is that they are too short for the numbers you're giving it to work with. You may need to use long doubles or unsigned long doubles.

Name: Anonymous 2012-04-27 7:42

Can't you use GDB to find out yourself the problem ?

Name: Anonymous 2012-04-27 8:13

Pastebin
Sepples
Half-assed Allman style
Eight spaces per tab
/*****************************************************************************
I've pinpointed a few problems.

Name: Anonymous 2012-04-27 8:15

>>2
Yes, it's well-known that assigning big numbers to float variables causes segfaults.

Name: Anonymous 2012-04-27 8:37

>>4
Eight spaces is the standard!!!

Name: Anonymous 2012-04-27 10:22

>>6
No, a tab is aligned to an 8-char (monospace) boundary, and the standard for space indentation is 2-4.

Name: Anonymous 2012-04-27 10:24

In power()
if (N = 0)
Is wrong for obvious reasons

sine() and cosine() fail because of power()

Name: Anonymous 2012-04-27 10:24

>>7
Two spaces is unreadable. GNU is pig.

Name: Anonymous 2012-04-27 10:55

And this is why -Wall -Wextra -pedantic -Werror.

Name: Anonymous 2012-04-27 15:45

Name: bampu pantsu 2012-05-29 4:39

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List