As impressive as your code is (I can't beat it) do you no agree that the order of evaluation of vowels can make a huge difference? Your code makes the order irrelevant of course but, in general, I...
Type: Posts; User: Hodor
As impressive as your code is (I can't beat it) do you no agree that the order of evaluation of vowels can make a huge difference? Your code makes the order irrelevant of course but, in general, I...
I was being sarcastic when I said "stupid" (Ok, maybe "sarcastic" is not the right word, I'm not sure, but I was certainly having a go at another user who thinks avoiding branches is the way to go)
The point I was trying to make was that optimisations do not necessarily come from "code"; they can come from other places (i.e. the order you compare aeiou can make a huge difference because of...
I don't think I can
It's just a branch. Writing in assembly the mnemonic has never (as far as I know) been "goto"; the example you give is a "C'ificiation"; it'll compile to an ASM branch instruction (which, yeah, are...
@awsdert Up front: I don't care if I get banned from here because of what I am about to say. I'm going to say it because I think it's important.
Stop showing code that is plainly incorrect,...
a) Using bitwise OR the way you used it there is broken (it won't work... seriously)
b) Yep, fair enough. I and many others find them annoying
c) GOTO is not an ASM instruction. I take it that you...
That's stupid, flp1969. You have branches (e.g. if ( is_vowel( *p ) )) in that code so it's just... stupid.
Ok, as a start I'll begin with this (no compiler optimisations)
//=========== Start of challenge code =========
int c;
while((c = getc(f)) != EOF) {
if (isalpha(c)) {...
With compiler optimisations turned on or off?
a) Why are you using bitwise OR?
b) Parenthesis where they're not required could, arguably, be regarded as clutter
c) I have no idea what you're talking about regarding the MUL, GOTO is. Further,...
In test_a(), remove the test for test being NULL because that's the responsibility of the calling function (i.e. test != NULL should be a pre-condition). Either way you are of course correct but...
Interesting... I'm running firefox on Ubuntu as well and the rendering is different. BUT I have MS core fonts installed so that's probably why mine looks different and doesn't overlap (?) That said,...
It's not doing that for me. The font my browser (firefox) is using is different as well
And of course: What Every Computer Scientist Should Know About Floating-Point Arithmetic
Well, yes. My chemistry textbooks are kind of old so I expect some progress has been made since they were printed LOL. I still think the polynomial is an approximation to fit empirical data though :P...
I understand your point, but the difference in your example is not a result of the loop, it's because calc_abv2() is using pow(). The loop could be modified to use pow() and it would give the same...
I don't know which of the below implementations below I prefer, but I do know that comments should be added (if there was comments in the initial code I'd not have initially thought it was...
Looking at it again I was mistaken. I didn't notice that the "coefficients" were being added backwards and the implementation is using methods described here: Horner's method - Wikipedia
Apologies...
I'd double check your implementation of calc_abv()... it doesn't seem to match your picture
As well as being valid only for 20C it is also only valid for inputs between 0.0 and 1.0 inclusive. Both of these constraints should be added as a comment. For the 0.0 to 1.0 you should probably add...
Yeah it built libalu_d.so ok (it's in the directory); it's not linking though
$ ls
1st.mak alu.h alu_int_d.o alu_math_d.o alu_uint_d.o cloned libalu_d.so test_d.o...
Unfortunately not (I did make clean first). But, just to make sure I deleted the directory and re-cloned your repo... exactly the same result as above
Still won't build for me
$ make --version
GNU Make 4.2.1
$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
$ make debug run
make debug
Already up to date. Current branch master is up to date.
Finished checking
cc -ggdb -D _DEBUG -fPIC -shared -Wall -Wextra -I cloned/fbstdc/include -o test_d.o -c test.c
cc -ggdb...