Click here to Skip to main content
15,907,910 members

Comments by amin.j (Top 35 by date)

amin.j 30-Oct-15 14:02pm View    
I used this code but it has error in 4th line:

# y= 0.4*x+1
li.s $f0, 0.4
mul.s $f2, $f0, $f1
floor.w.f $f3, $f2
amin.j 30-Oct-15 10:25am View    
As I know:

mul.d $destination, $source, $source

the third one is the second float pint for multiplying. But, my case is different, I want to multiply one integer in $t1 with a float in $f0; how can I do that?
amin.j 30-Oct-15 7:33am View    
I have an integer value in register $t1 and I want to multiply it with 0.4 but it has error in the second line:

li.s $f0, 0.4
mul.d $f1, $f0, $t1
mfhi $a2
mflo $v0

# print the result
li $v0, 2 # load appropriate system call code into reg $v0
la $a0, 0($v0) # load address of string to be printed on $a0
syscal
amin.j 18-Oct-15 3:44am View    
This code is working:
if(*(static_cast<const int*="">(elem1)) == *(static_cast<const int*="">(elem2)))
amin.j 18-Oct-15 3:02am View    
How can do the same for Class data type, here DayOfear:

bool equals_class(const void* elem1, const void* elem2){
`if ((*(DayOfYear*)elem1).month == (*(DayOfYear*)elem2).month && (*(DayOfYear*)elem1).day == (*(DayOfYear*)elem2).day){`

I use this one:
`if ((*(static_cast<dayofyear*>(elem1)).month == (*(static_cast<dayofyear*>(elem2)).monthh &&
(*(static_cast<dayofyear*>(elem1)).day == (*(static_cast<dayofyear*>(elem2)).day){`

but it makes error:
static_cast from type 'const void*' to type 'DayOfYear*' casts away qualifiers|