makes sense, but leaves me with the question of how do i make a generalized function to mask the exp bits or frac bits when I don't know beforehand how many bits there are to be masked.
Type: Posts; User: Roadrunner2015
makes sense, but leaves me with the question of how do i make a generalized function to mask the exp bits or frac bits when I don't know beforehand how many bits there are to be masked.
still playing around with it.... it seems as though the left shifts are shifting past the amount of bits there are supposed to be.
i.e. 1 sign 2 exp 2 frac
1 00 00
if i...
x is value
y is number of exp bits
z is number of frac bits
unsigned getExp(unsigned x, unsigned y, unsigned z) {
x = (x << 1); // trying to clear out sign bit
x = (x...
im shifting << then >> to try and clear out all bits that I don't care about but it seems as though they aren't being padded with 0's. These are unsigned numbers.
I have an assignment where I am trying to get the frac bits of a IEEE number representation. The number of exp and frac bits are given as parameters from the main, but I am unsure what bit mask to...
Thank you very much for taking the time to answer. I am embarrassed to say the problem was my lack of focus while reading. The bias in this assignment was 7, not 127. Diving by 7 resulted in no...
Hello, and sorry if this is a question that should be known. I am writing a function to give me the value of an IEEE-floating point denormalized number. The problem I am running into is the 2E, E...
Thank you, this is the second time I've made this mistake. I need to pay attention to the details more. Thank you again, though.
Hello, I am getting different answers than my professor on my review and was wondering if someone could explain to me either what I'm doing wrong, or can confirm that I'm doing it correctly.
The...
This! Thank you. And I understand the reasoning for the whole (char *) deal, in my words it's to give rule on how this code should be read. The machines, I assume, write AND read in the same...
deleted
Assuming sizeof(int) = 4 ::
My question is what 'y' would be following the code
int x = 0x1234567;
char *p = (char *)&x;
int y = (int)(*p);
(a) On a little endian machine
(b) On a big...
Which is more efficient and why?
int a, *p=&a, i;
for(a=0,i=0;i < 10000; i++) a=a+1;
or
for(*p=0,i=0; i < 10000; i++) *p=*p+1;
nvm, figured it out. I had to reset where my cursor pointer was before i started the loop again :wink: cheers for fixing a head ache
Just placed 1 into cp->element.
cp -> element is now 1
Try 1: 1 integer in this set
A = {}
Just placed 2 into cp->element.
cp -> element is now 2
Try 2: 2 integers in...
would it be better to use char *str or an array of characters? (str[xxx])
here would be my stack after pushing <title> and <b>
-
-
-
<b>
<title>
I now come across </title> (its wrong!) and i pop the stack..... so from there do i strtok() the '/' out of...
I don't see the difference in comparing
<title><b>Hey</b></title>
with
<title><b>Hey</title></b>
I understand that they are obviously different and the second example being wrong......
I'm not sure how I could distinguish between a one sided tag and an open or close tag when coming across the first <?
Also, I am not sure how to check.. lets say... if the first <title> tag...
Hello I had a quick question about how to check the balance of brackets in an HTML file using a stack (pushing and popping). I understand pushing and popping. I get lost when it comes to the logic of...
Laserlight caught this, was an accident from editing my code before.
I checked in main.
True, will have to fix. Although I do believe they are all working so I don't think that is the stack...
whoops, i had re-done my code and i guess forgot that line. Thanks for the catch. Any idea on the stack smash though?
*** stack smashing detected ***: ./driver terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7f79da8]...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX 100
#define MAX_WORD 50
static char* array[MAX];
static int max_lines;
void InitDictionary(FILE *possible_words){
My structure is
typedef struct {
string name;
string title;
string ssnum;
double salary;
int withholding;
} employeeRecordT;