float

Is if ( double\float(x) ) valid C++ code?

I just ran into this line of code; if( lineDirection.length2() ){...} where length2 returns a double. It kind of puzzles me that 0.0 in this case is equivalent to 0\NULL. Is this part of the C++ standard or is it undefined behaviour? ...

How do i make a fluid float:left layout?

For example, i'd like to have a grid of boxes all floating left. I have the design here: atbskate.com/trusktr. The boxes on my site are all float:left. However, when i expand a box by adding content into it (ajax) it shifts the other boxes and leaves an ugly empty space. I'd like for the boxes to fill up this empty space. The idea woul...

Workaround rendering bug in IE quirks mode

I'm trying to get a simple HTML/CSS page to work as an eBay template, however it fails to render properly in IE. Thanks to eBay's HTML choices, the listing will always render in quirks mode (no doctype reference in the listing's iframe). The problem only arises when a browser window is narrower than the listing asks for (~1000px). I've t...

Div collapses horizontally to width of widest inner element

I am having an issue with collapsing divs in CSS! But not the normal issue. That would be too easy. I have a left floating div which contains two left floated divs. The first of the left floated divs contains text. If the second inner floated div's style is empty, everything works fine and the outer div encompasses the text and both inne...

How do I display 2 sections side-by-side?

I have following HTML code: <section class="indent-1"> <!-- Section 1 --> <section> <div>Some content</div> <div>Some more</div> </section> <!-- Section 2 --> <section> <div>Some content</div> <div>Some more</div> </section> </section> And I'd like to display Section 1 on the ...

IE7 (IE8 Compatability Mode) bug: crazy amound of width applied to a floated element that is parent to another float.

Here's my problem. It looks perfect in Firefox, Safari, IE8, but in IE7 and IE8 comparability mode, it adds about 4000px of width to the div.team elements nested within the list item. the problem goes away if i remove the span.score elements. The image attached shows the score in the first box in white number text. The top image is th...

Division by Zero Errors

Mann i have a problem with this question from my professor. Here is the question: Write the definition of a function typing_speed , that receives two parameters. The first is the number of words that a person has typed (an int greater than or equal to zero) in a particular time interval. The second is the length of the time interval i...

Segmentation fault after declaring a variable inside structure

I am currently working on a project using network simulator 2. When I add variable inside the structure re_block, the program compiles but gives me segmentation fault during runtime. When i declare the variable as static there is no runtime error. Someone please explain this. struct re_block { # if __BYTE_ORDER == __BIG_ENDIAN u_int16_...

C++: Store large numbers in a float like PHP?

In PHP if you go above INT_MAX it will cast it as a float, allowing very high numbers to be formed (that are non-decimal as well), is this possible to do in C++ or are the way they store floating point/double precision numbers different? The reason why is I am wishing to benchmark large factorials, but something such as 80! is way too l...

Float in div tag dosen't Work in Firefox

In IE show correctly but in FF Doesn't Show correctly: <div class="main_div" dir="rtl"> <div class="outer_div" dir="rtl"> <div class="textformatting" dir="rtl"> <div class="inner_div"> text </div> <div class="inner_div"> Image </div> </div> </div> <div class="outer_div" dir="rtl"> ...

IE7 Display issues

A lot of my floats are showing up on a separate line when viewing in IE7 ... in Ffox, chrome, IE8 etc they look fine. The site in question is: http://208.43.52.30 The places where the float is not working are the location for "events near me", "Show" for the show month buttons .. I'll attach some screenshots IE 8: IE 7: ...

How to float paragraph next to image without wrapping the image?

Hello! I want to float a paragraph next to image, but without wrapping the image. Like this: div.img { float: left; display: block; margin: 15px 2% 0 2%; width: 26%; /* I cannot use that */ } div.info { float: right; display: block; margin: 15px 2% 0 2%; width: 66%; /* Th...

Floating layout similar to HTML/CSS

In HTML/CSS, if you float items, DIV's that exceed the width of the container are moved down 1 line. I would like to achieve this in FLEX. I have 3 components with variable width. I would like for the 3rd component to be moved down when it doesnt fit the container any more. ...

How to convert from float to bigDecimal in java?

How to convert from float to bigDecimal in java? ...

Float divs with variable heights (arrange)

Hello! I'm having a simple problem concerning the arrangement of floating divs with variables heights. The goal: http://i.imgur.com/yngM5.jpg The result: see below, can't post more than one link - I just have div containers with css float: left; and no height defined. The first red circle indicated that my technique fails, althou...

C# Comparing float to int

I have seen this code floating around on the intertubes for determining if a Windows Mobile device has a VGA screen (code is inside a method of a Form class): SizeF currentScreen = this.CurrentAutoScaleDimensions; bool isVGA = currentScreen.Height == 192; Is it possible that isVGA could be set to false even if the screen is VGA becaus...

Formatting of single precission IEEE 754 floating point numbers

I need to represent single precision numbers as text in a way that won't lose any information (so I can get the same number back, possibly disregarding NaNs etc.), but without too many spurious digits - so single precision 0.1 comes out as "0.1" not "0.100000001490116". I'm not trying to save bytes, these extra digits are just confusing...

CSS float left and right in paragraph with span?

Until now, when I had one line with example previous --- page width --- next I used a container div with 2 children, styled float:left & float:right I am think it could be done from one paragraph line with span's maybe something like: <p><span class="s-left">previous</span><span class="s-right">next</span></p> I tried CSS with: sp...

Algorithm or code for float to base 2 scientific notation (IEEE 32 bits) in C++?

I'm taking in a float as input, and then outputting its equivalent representation in base 2 scientific notation. This is in IEEE 32 bits with: 31 sign bit, 23-30 exponent (with 127 offset), 0-22 mantissa (with implicit leading 1). One of the conditions which I'm not exactly sure the meaning of is "Your mantissa should have the implicit ...

Floating Div boxes limited by magic

Hello, Heres the link to the page In question.... http://team2648.com/OTIS2/DivTest.html So If you look at that page, If your browser is small enough, you see that below the box with the red background, there is a bit of space, Why doesn't the box below float up? The HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//E...