On my page (http://www.50allstars.com/2017/10/test.html) I'm attempting to align some divs, but the middle div shifts downward whenever I view it on mobile. I've tried adjusting widths, maybe it has something to do with the device-width property, but I really have no clue. Any help would be great. I've included screenshots of both desktop and mobile, and you can view the source code on [the page](http://www.50allstars.com/2017/10/test.html). THANKS! PS This is my absolute first time experimenting with doing any sort of layout that didn't include a TABLE. I was told by folks on this site that I needed to update my knowledge …

Member Avatar
Member Avatar
+0 forum 1

I'm working on a program that requires some very low level optimization. My question is, when precision isn't an important factor, how can I automatically use the most efficient floating point type for whatever architecture the program is being run on? As far as I'm aware, floats are more efficient on 32 bit systems, and doubles are more efficient on 64 bit systems. Is there some sort of keyword or macro I can use which always uses the native data type for the machine it's being run on? Thanks, appreciate any help.

Member Avatar
+0 forum 0

Hey, I'm making a website, and have some css to put two divs next to each other. This is my css and HTML code : [CODE].class1 { float:left; border-right:2px solid #000; } .class2 { float:right; } .class3 { clear:both; }[/CODE] HTML : [CODE] <div class="class1"> Div 1 </div> <div class="class2"> Div 2 </div> <div class="class3"> <!-- I'm working in a container div. --> </div> [/CODE] At the moment it comes out like this : [CODE] Div1 | Div 2 [/CODE] but I want to make it like this : [CODE] Div 1 | Div 2 [/CODE] Any ideas how to …

Member Avatar
Member Avatar
+0 forum 8

I am trying to make a function that rounds number.. I declared the function above the main and voided it Then I recalled the function in the program and listed the variables needed in brackets and then I wrote the function I can't work out what is wrong. [ICODE]#include<stdio.h> #include<math.h> void round2int(float,float); int main (void) { float roundednum,x; do { printf("Enter a number (Enter zero (0) to quit program)"); scanf("%f",&x); round2int(x,roundednum); } while(x!=0); fflush(stdin); getchar(); return 0; } void round2int(float test, float number) { float number,test; number=floor(test+05); printf("%f",number); }[/ICODE]

Member Avatar
Member Avatar
+0 forum 8

hello, [CODE] <div> <div class="floatLeft"></div> <div class="center"></div> <div class="floatRight"></div> </div> [/CODE] The question is - how do I make the div with class "center" actually in the center. Those 3 divs doesn't take all the width available. Another divs are floated as class name says.Or should I use different technique?

Member Avatar
Member Avatar
+0 forum 10

Hey, I want my ads to float in the right sidebar as "Daniweb." On Daniweb the social sharing buttons and related posts are sticky, I want the same configuration for my website.

Member Avatar
Member Avatar
+0 forum 5

i have two different programs that compare float and double variales and gives output , i shown that below : 1. #include<stdio.h> main() { int r; float f=22.5; double d=22.5; r=(f==d); printf("r=%d",r); } **Output:- r=1** 2. #include<stdio.h> main() { int r; float f=22.7; double d=22.7; r=(f==d); printf("r=%d",r); } **Output:- r=0** why this happen that for 22.5 both are same and gives o/p 1 and 22.7 both (f & d) are different and gives o/p 0

Member Avatar
Member Avatar
+0 forum 4

i have a function which is supposed to check if a number is a floating-point number. this is the structure of the function function isValidFloat( $string ){ if( !preg_match( "/^[0-9]+(.[0-9]+)?$/", $string ) ){ return false; } } for numbers such as 1 or 8 it's correctly validating but not for floating point numbers such 19.25. where am i missing it

Member Avatar
Member Avatar
+0 forum 3

hi all not been here for a while, a long time since i have been working in the industry but ha life goes on haha. I am stuck trying to get the layout to work exactly how i would like, i have a container div which i would like to hold a set of smaller divs (body panel) which are all lined up next to each other with. i have tried a few different ways to get them to sit next to each other but all have been no use up to now. the closest i have got to getting …

Member Avatar
Member Avatar
+0 forum 2

Hi - I am having an issue and can't seem to get my head around it. I am trying to calculate GBP from EUR - which should be easy but for some reason my returned value is always a few GBP more than it should be, yet I do the same calculation on my calculator or Google and it's right. Can anyone see what I am doing wrong? I have this: $rate = 1.20881; //var_dump shows float, tried different combos too $euro = 74; //var_dump shows float $gbp = ($euro / $rate); //should give me 61.21 but it keeps giving …

Member Avatar
Member Avatar
+0 forum 2

I am reading these values from a file 12.1 13.4 12.4find gg 16.77 56.55 My program should display the average of 5 float no and ignore find and gg. I did while((inputfile >> f)) { //cout << "ssss"; //continue; //} sum += f; count ++; cout << fixed << f << endl; } cout << setprecision(2) << fixed << count <<endl; cout << "average : " << sum/count << endl; but it shows 12.100000 13.400000 12.400000 3 average : 12.63 Any suggestions

Member Avatar
Member Avatar
+0 forum 1

I am reading these values from a file 12.1 13.4 12.4find gg 16.77 56.55 My program should display the average of 5 float no and ignore find and gg. I did while((inputfile >> f)) { istringstream iss(f); if(!(iss(f)) { iss.clear(); continue; } sum += f; count ++; cout << fixed << f << endl; It is not giving the right result.

Member Avatar
Member Avatar
+0 forum 1

i am getting result of average in int instead of float, tell me where i have made mistake. this is the code. #include<iostream> using namespace std; void getData (int a[], int s); int numbersSum (int a[], int s); float average (int sum, int size); int main() { int size=0; int a[size]; cout<<"how many numbers: "<<endl; cin>>size; cout<<"Enter "<<size<<" numbers:"<<endl; getData (a, size); int sum=0; sum=numbersSum (a, size); cout<<"sum of these "<<size<<" numbers is "<<sum<<endl; float avg=0; avg=average (sum, size); cout<<"the average of these "<<size<<" numbers is "<<avg<<endl; return 0; } void getData(int a[], int s) { for (int i=0;i<s;i++) { …

Member Avatar
Member Avatar
+0 forum 3

def main(): print ('Welcome to the mpg calculator program') print() #get the miles driven using the input function miles_driven = input ("Please enter miles driven: ") miles_driven = float (miles_driven) #get the gallons used using the input function gallons_used = input ("Please enter gallons used: ") galons_used = float (gallons_used) #calculate mpg here, using the inputted values mpg = miles_driven / gallons_used print('The MPG based on', format(miles_driven, '.2f'),\ 'miles driven and with', format(gallons_used, '.2f'), \ 'gallons used is:', format(MPG, '.2f'),sep=' ') #calls main main() >>> Welcome to the mpg calculator program Please enter miles driven: 200 Please enter gallons used: …

Member Avatar
Member Avatar
+0 forum 7

Hi, I want to convert a float value to 32bit hex and the code I have right now returns 64bit hex. The float is stored in a string called value. [CODE] result = Convert.ToDouble(value); long lVal = BitConverter.DoubleToInt64Bits(result); string hex = lVal.ToString("X"); OutputBox.Text += ("\nConverted the " + value.GetType().Name + " value '" + value + "' to the " + hex.GetType().Name + " value " + hex + ".");[/CODE] Example output: Converted the String value '-2.07217' to the String value C00093CDDD6E04C0. How would I do this?

Member Avatar
Member Avatar
+0 forum 4

Hi all, I seem to have an issue with my CSS. The page setup that has the issue is: <footer> <section 1></section 1> <section 2></section 2> <section 3></section 3> </footer> The sections are set to 33% width and floating left. The containing footer does not seem to expand in height: What it looks like (very rough still) http://deval.roundthebend.info/about_us.php

Member Avatar
Member Avatar
+0 forum 2

For my webpage I want to set up columns (boxes). For example I have an image floating to the left then I want to float another image or a plain box underneath the image. This is my HTML code <div style="float: left; background-color: white;"> <img src="Images/Books.jpg" alt="Books" width="225" height="125"/> </div> <div id="left-col">some text</div> My image is floating left and I want my left column to float underneath it. I tried using the <br> tag but if I want to include a center column the <br> would not work... This is my CSS code #left-col { position: ; float: left; height: …

Member Avatar
Member Avatar
+0 forum 2

hello everyone ,, have a look on the program really difficult for me to understand the concept please help

Member Avatar
Member Avatar
+0 forum 1

how to make the image shows side by side but center of the div thankx in advance the css used .img-wrap { width:200px; margin: auto; } .img-wrap img{ display:inline-block; float:left; } the html <div class="img-wrap"> <img src="img/first.png" /><img src="img/second.png" /> </div>

Member Avatar
Member Avatar
+0 forum 7

Hi, I want to declare a float[] in .h and initialize in .m as explained below: .h file ` @interface A: NSObject { float data[10]; } @end ` .m file @implementation A -(void) loadData{ data={1,2,3,4,5,6,7,8,9,10};//Does not work } @end I could have intialized in the following manner, but Could it be intialized in the above manner. data[0]=1.0,.....data[9]=10.0

Member Avatar
Member Avatar
+0 forum 3

Hello this is my first post here, Google has led me to this site a few times and I made an account today to ask a question about CSS Floats. I have Django code to generate a DIV for each srvr object in my database. Here is my HTML: {% for srvr in server_list %} <div class="server"> <p> <h3 {% if srvr.dead %}class="dead"{% endif %}>{{ srvr }}</h3> Working: {% if srvr.dead %}No{% else %}Yes{% endif %}<br /> Backed Up: {{ srvr.backed_up }}<br /> Updated: {{ srvr.last_updated }}<br /> </p> </div> {% endfor %} And here is my CSS: html { …

Member Avatar
Member Avatar
+0 forum 2

I am currently working in a Statistics Calculator which should display mean, standard deviation, median and mode. I have the graphical interface ![Sin_título](/attachments/large/4/Sin_título.png "Sin_título") This one has a text box where you get to write the list and by clicking the button it stores the fist value and goes to the next and that goes on until you finish and click on an other button to operate the list of values. My question is the following, How can I change the size of the arrrage according to the list they are inputting to the array?

Member Avatar
Member Avatar
+0 forum 2

I understand that when casting a string to a float, php will evaluate from left to right and stop at the first invalid character. So for example, the string "1-23" will cast to a 1. I need to evaluate the entire string though, so that the string "1-23" would not successfully cast. Is this possible?

Member Avatar
Member Avatar
+0 forum 2

Hi all, I have a menu on the left side of my design. When the user scrolls and the object hits the top of the screen I want it to float there. I have the float working fine now, but how can I say "Only float when you meet the top of the display?" This is the CSS for the object: .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: …

Member Avatar
Member Avatar
+0 forum 4

Hi everyone :). **Strange situation** with this code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <body> <div align="center"> <div style="width: 500px; background-color: blue"> <div style="width: 200px; float: left"> <p>Some text.</p> </div> <div style="width: 210px; float: right"> <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/13/DuskyDolphin.jpg/220px-DuskyDolphin.jpg" alt="Dolphin"> </div> </div> </div> </body> </html> Display in **IE** (9) is **OK**, in **Chrome** is **problem**. Where is mistake? Thanks a lot :).

Member Avatar
Member Avatar
+0 forum 5

I have been reading some tutorials about floats from various sources on the web. They say that if you want to float one div element next to another you are to put a float attribute into one of the div elements. for example one website says this... > Quote From - [maxdesign.com](http://css.maxdesign.com.au/floatutorial/tutorial0807.htm) To float the left nav, we need to use the rule: "#leftnav {float: left;}". When a div is set to float, a width must also be included, so we can add another declaration: "width: 160px;". However, none of these examples appear to work within my code. When I …

Member Avatar
Member Avatar
+0 forum 4

I have the code below #include <stdio.h> int main(){ float n; scanf("%f",&n); printf("%f",n); return 0; } Then, I run the code input: 45321.56 is not same with output:45321.558594 I want to get output which same as the input. How to solve this problem? Thank you

Member Avatar
Member Avatar
+0 forum 7

Hi there, I'm having trouble with floats in Java. My program accepts a number in the form of a float. The number typically has two decimals (but not always). It seems to work fine in most cases. For example, I could put in 54.67, and that number would be passed to another function. Great. However, my problem is this: If I put in 54.60 as the number, it gets set as a float, which automatically rounds it to 54.6, and passes **that** to the other function. The other function doesn't work properly when this 0 is dropped. So my question …

Member Avatar
Member Avatar
+0 forum 4

I made a website that has a floated div which contains the contact form. The entire website can be seen on all platofrms and on all browsers except for teh contact form. After some research I believe the floatd div is rpeventing the contact form from being viewed on tablets (eg. iPad) and phones. How can I circumvent this problem without sacrificing the layout? If you'd like to see [the site](http://www.ezaspi.org) feel free. Thanks for help in advance.

Member Avatar
Member Avatar
+0 forum 2

So ive been trying to get an average of this array needed, and I seem to be having trouble with it. So far, my current code just adds the numbers up, but doesnt really average them out at all: [CODE]import java.util.Scanner; import java.util.Arrays; public class Grades { public static void main (String[] args) { double result = 0; Scanner scan = new Scanner(System.in); float[] grades = new float[100]; for (int i = 0; i < grades.length; i++) { System.out.print("Enter a grade between 0.0 - 100.0 (enter -1 to quit): "); grades[i] = scan.nextFloat(); if(grades[i] == -1)break; result = result + …

Member Avatar
Member Avatar
+0 forum 8

The End.