Search Results

Search found 520 results on 21 pages for 'division'.

Page 3/21 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C# is there a problem with division?

    - by Tom
    This is a piece of my code, it is called every second, after about 10 seconds the values start to become weird (see below): double a; double b; for (int i = 0; i < currAC.Length; i++ ) { a = currAC[i]; b = aveACValues[i]; divisor = (a/b); Console.WriteLine("a = " + a.ToString("N2") + "\t" + "b = " + b.ToString("N2")); Console.WriteLine("divisor = " + divisor); Console.WriteLine("a+b = " + (a+b)); } and the output: a = -0.05 b = 0.00 divisor = 41 a+b = -0.0524010372273268 currAC and aveACValues are double[] what on earth is going on???? The addition result is correct every time, but the division value is wrong, yet it is reading a and b correctly?? EDIT: '41' is the value of the first calculation, ie when a = currAC[0], but this should not remain???

    Read the article

  • Fast ceiling of an integer division in C / C++

    - by andand
    Given integer values x and y, C and C++ returns as the quotient q = x/y the floor of the floating point valued equivalent. I'm interestd in a method of returning the ceiling instead? For example, ceil(10/5) = 2 and ceil(11/5) = 3. The obvious approach involves something like: q = x / y; if (q * y < x) ++q; This requires an extra comparison and multiplication; and other methods I've seen (used in fact) involve casting as a float or double. Is there a more direct method that avoids the additional multiplication (or a second division) and branch, and that also avoids casting as a floating point number?

    Read the article

  • Please explain how Trial Division works for Primality Test

    - by mister_dani
    I came across this algorithm for testing primality through trial division I fully understand this algorithm static boolean isPrime(int N) { if (N < 2) return false; for (int i = 2; i <= Math.sqrt(N); i++) if (N % i == 0) return false; return true; } It works just fine. But then I came across this other one which works just as good but I do not fully understand the logic behind it. static boolean isPrime(int N) { if (N < 2) return false; for (int i = 2; i * i<N; i++) if (N % i == 0) return false; return true; } It seems like i *i < N behaves like i <= Math.sqrt(N). If so, why?

    Read the article

  • Division of text follow the cursor via Javascript/Jquery

    - by webzide
    Dear experts, I wanted have a dynamic division of content follow you with the cursor in the web browser space. I am not a pro at JS so I spent 2 hours to finally debugged a very stupid way to accomplish this. $(document).ready(function () { function func(evt) { var evt = (evt) ? evt : event; var div = document.createElement('div'); div.style.position = "absolute"; div.style.left = evt.clientX + "px"; div.style.top = evt.clientY + "px"; $(div).attr("id", "current") div.innerHTML = "CURSOR FOLLOW TEXT"; $(this).append($(div)); $(this).unbind() $(this).bind('mousemove', function () { $('div').remove("#current"); }); $(this).bind('mousemove', func); } $("body").bind('mousemove', func) }); As you can see this is pretty much Brute force and it slows down the browser quite a bit. I often experience a lag on the browser as a drag my mouse from one place to another. Is there a way to accomplish this easier and faster and more intuitive. I know you can use the cursor image technique but thats something I'm looking to avoid. Thanks in advance.

    Read the article

  • ArithmeticException thrown during BigDecimal.divide

    - by polygenelubricants
    I thought java.math.BigDecimal is supposed to be The Answer™ to the need of performing infinite precision arithmetic with decimal numbers. Consider the following snippet: import java.math.BigDecimal; //... final BigDecimal one = BigDecimal.ONE; final BigDecimal three = BigDecimal.valueOf(3); final BigDecimal third = one.divide(three); assert third.multiply(three).equals(one); // this should pass, right? I expect the assert to pass, but in fact the execution doesn't even get there: one.divide(three) causes ArithmeticException to be thrown! Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result. at java.math.BigDecimal.divide It turns out that this behavior is explicitly documented in the API: In the case of divide, the exact quotient could have an infinitely long decimal expansion; for example, 1 divided by 3. If the quotient has a non-terminating decimal expansion and the operation is specified to return an exact result, an ArithmeticException is thrown. Otherwise, the exact result of the division is returned, as done for other operations. Browsing around the API further, one finds that in fact there are various overloads of divide that performs inexact division, i.e.: final BigDecimal third = one.divide(three, 33, RoundingMode.DOWN); System.out.println(three.multiply(third)); // prints "0.999999999999999999999999999999999" Of course, the obvious question now is "What's the point???". I thought BigDecimal is the solution when we need exact arithmetic, e.g. for financial calculations. If we can't even divide exactly, then how useful can this be? Does it actually serve a general purpose, or is it only useful in a very niche application where you fortunately just don't need to divide at all? If this is not the right answer, what CAN we use for exact division in financial calculation? (I mean, I don't have a finance major, but they still use division, right???).

    Read the article

  • Picking good first estimates for Goldschmidt division

    - by Mads Elvheim
    I'm calculating fixedpoint reciprocals in Q22.10 with Goldschmidt division for use in my software rasterizer on ARM. This is done by just setting the nominator to 1, i.e the nominator becomes the scalar on the first iteration. To be honest, I'm kind of following the wikipedia algorithm blindly here. The article says that if the denominator is scaled in the half-open range (0.5, 1.0], a good first estimate can be based on the denominator alone: Let F be the estimated scalar and D be the denominator, then F = 2 - D. But when doing this, I lose a lot of precision. Say if I want to find the reciprocal of 512.00002f. In order to scale the number down, I lose 10 bits of precision in the fraction part, which is shifted out. So, my questions are: Is there a way to pick a better estimate which does not require normalization? Also, is it possible to pre-calculate the first estimates so the series converges faster? Right now, it converges after the 4th iteration on average. On ARM this is about ~50 cycles worst case, and that's not taking emulation of clz/bsr into account, nor memory lookups. Here is my testcase. Note: The software implementation of clz on line 13 is from my post here. You can replace it with an intrinsic if you want. #include <stdio.h> #include <stdint.h> const unsigned int BASE = 22ULL; static unsigned int divfp(unsigned int val, int* iter) { /* Nominator, denominator, estimate scalar and previous denominator */ unsigned long long N,D,F, DPREV; int bitpos; *iter = 1; D = val; /* Get the shift amount + is right-shift, - is left-shift. */ bitpos = 31 - clz(val) - BASE; /* Normalize into the half-range (0.5, 1.0] */ if(0 < bitpos) D >>= bitpos; else D <<= (-bitpos); /* (FNi / FDi) == (FN(i+1) / FD(i+1)) */ /* F = 2 - D */ F = (2ULL<<BASE) - D; /* N = F for the first iteration, because the nominator is simply 1. So don't waste a 64-bit UMULL on a multiply with 1 */ N = F; D = ((unsigned long long)D*F)>>BASE; while(1){ DPREV = D; F = (2<<(BASE)) - D; D = ((unsigned long long)D*F)>>BASE; /* Bail when we get the same value for two denominators in a row. This means that the error is too small to make any further progress. */ if(D == DPREV) break; N = ((unsigned long long)N*F)>>BASE; *iter = *iter + 1; } if(0 < bitpos) N >>= bitpos; else N <<= (-bitpos); return N; } int main(int argc, char* argv[]) { double fv, fa; int iter; unsigned int D, result; sscanf(argv[1], "%lf", &fv); D = fv*(double)(1<<BASE); result = divfp(D, &iter); fa = (double)result / (double)(1UL << BASE); printf("Value: %8.8lf 1/value: %8.8lf FP value: 0x%.8X\n", fv, fa, result); printf("iteration: %d\n",iter); return 0; }

    Read the article

  • Question with R. Element wise multiplication, addition, and division with 2 data.frames with varying

    - by Michael
    I have a various data.frames with columns of the same length where I am trying to multiple 2 rows together element-wise and then sum this up. For example, below are two vectors I would like to perform this operation with. > a.1[186,] q01_a q01_b q01_c q01_d q01_e q01_f q01_g q01_h q01_i q01_j q01_k q01_l q01_m 3 3 3 3 2 2 2 3 1 NA NA 2 2 and > u.1[186,] q04_avl_a q04_avl_b q04_avl_c q04_avl_d q04_avl_e q04_avl_f q04_avl_g q04_avl_h q04_avl_i q04_avl_j q04_avl_k q04_avl_l q04_avl_m 4 2 3 4 3 4 4 4 3 4 3 3 3` The issue is that various rows have varying numbers of NA's. What I would like to do is skip the multiplication with any missing values ( the 10th and 11th position from my above example), and then after the addition divide by the number of elements that were multiplied (11 from the above example). Most rows are complete and would just be multiplied by 13. Thank you!

    Read the article

  • latex large division sign in a math formula

    - by Anna
    Hi, I have been looking for an answer for some time now, hope you could give me a quick tip. I have an equation with many divisions inside. i.e: $\frac{\frac{a_1}{a_2}} {\frac{b_1}{b_2}}$ To make it more readable, I decided to change the large fraction into "/" sign. i.e. $\frac{a_1}{a_2} / \frac{b_1}{b_2}$ The problem is that the "/" sign remains small, and it is quite ugly. How do I change the "/" sign to have a big font? How do I make it more readable? Thanks.

    Read the article

  • Fast modulo 3 or division algorithm?

    - by aaa
    Hello is there a fast algorithm, similar to power of 2, which can be used with 3, i.e. n%3. Perhaps something that uses the fact that if sum of digits is divisible by three, then the number is also divisible. This leads to a next question. What is the fast way to add digits in a number? I.e. 37 - 3 +7 - 10 I am looking for something that does not have conditionals as those tend to inhibit vectorization thanks

    Read the article

  • BigDecimal, division & MathContext - very strange behaviour

    - by blackliteon
    CentOs 5.4, OpenJDK Runtime Environment (build 1.6.0-b09) MathContext context = new MathContext(2, RoundingMode.FLOOR); BigDecimal total = new BigDecimal("200.0", context); BigDecimal goodPrice = total.divide(BigDecimal.valueOf(3), 2, RoundingMode.FLOOR); System.out.println("divided price=" + goodPrice.toPlainString()); // prints 66.66 BigDecimal goodPrice2 = total.divide(BigDecimal.valueOf(3), new MathContext(2, RoundingMode.FLOOR)); System.out.println("divided price2=" + goodPrice2.toPlainString()); // prints 66 BUG ?

    Read the article

  • how to apply group by on xslt elements

    - by Amit
    Hello All, I need to group the value based on some attribute and populate it. below mentioned is i/p xml and if you see there are 4 rows for Users and for id 2,4 Division is same i.e. HR while generating actual o/p I need to group by Division ... Any help ??? I/P XML <Users> <User id="2" name="ABC" Division="HR"/> <User id="3" name="xyz" Division="Admin"/> <User id="4" name="LMN" Division="Payroll"/> <User id="5" name="PQR" Division="HR"/> </Users> expected Result: I need to group the values based on Division and populate i.e. <AllUsers> <Division value="HR"> <User> <id>2</id> <name>ABC</name> </User> <User> <id>5</id> <name>PQR</name> </User> </Division> <Division value="ADMIN"> <User> <id>3</id> <name>XYZ</name> </User> </Division> <Division value="Payroll"> <User> <id>4</id> <name>LMN</name> </User> </Division> </AllUsers>

    Read the article

  • MVVM and division of amongst multiple developers

    - by nlawalker
    Can anyone speak to the ease of dividing work amongst multiple developers when designing and building a medium- to large-complexity Silverlight or WPF application? My team is finding it difficult to cleanly split work when you've got, for example, a number of controls that provide different visualizations of a Model/ViewModel that's fairly complex and has a lot of properties and methods for interacting with data. It seems like a very big portion of the work ends up being the design and build of the Model/ViewModel, and much less inside each of the controls, which are naturally what are easy to ration out to multiple people.

    Read the article

  • Modular Inverse and BigInteger division

    - by dano82
    I've been working on the problem of calculating the modular inverse of an large integer i.e. a^-1 mod n. and have been using BigInteger's built in function modInverse to check my work. I've coded the algorithm as shown in The Handbook of Applied Cryptography by Menezes, et al. Unfortunately for me, I do not get the correct outcome for all integers. My thinking is that the line q = a.divide(b) is my problem as the divide function is not well documented (IMO)(my code suffers similarly). Does BigInteger.divide(val) round or truncate? My assumption is truncation since the docs say that it mimics int's behavior. Any other insights are appreciated. This is the code that I have been working with: private static BigInteger modInverse(BigInteger a, BigInteger b) throws ArithmeticException { //make sure a >= b if (a.compareTo(b) < 0) { BigInteger temp = a; a = b; b = temp; } //trivial case: b = 0 => a^-1 = 1 if (b.equals(BigInteger.ZERO)) { return BigInteger.ONE; } //all other cases BigInteger x2 = BigInteger.ONE; BigInteger x1 = BigInteger.ZERO; BigInteger y2 = BigInteger.ZERO; BigInteger y1 = BigInteger.ONE; BigInteger x, y, q, r; while (b.compareTo(BigInteger.ZERO) == 1) { q = a.divide(b); r = a.subtract(q.multiply(b)); x = x2.subtract(q.multiply(x1)); y = y2.subtract(q.multiply(y1)); a = b; b = r; x2 = x1; x1 = x; y2 = y1; y1 = y; } if (!a.equals(BigInteger.ONE)) throw new ArithmeticException("a and n are not coprime"); return x2; }

    Read the article

  • GCC compile time division error

    - by kartikmohta
    Can someone explain this behaviour? test.c: #include <stdio.h> int main(void) { printf("%d, %d\n", (int) (300.6000/0.05000), (int) (300.65000/0.05000)); printf("%f, %f\n", (300.6000/0.05000), (300.65000/0.05000)); return 0; } $ gcc test.c $ ./a.out 6012, 6012 6012.000000, 6013.000000 I checked the assembly code and it puts both the arguments of the first printf as 6012, so it seems to be a compile time bug.

    Read the article

  • division problems

    - by David
    This line of code: System.out.println ("aray[j], "+aray[j]+", divided by sum, "+sum+", equals: aray[j]/sum: "+ aray[j]/sum) ; is yeilding this line of text: aray[j], 21, divided by sum, 100, equals: aray[j]/sum: 0 why is it doing this? (everything is right eccept that the answer should be .21)

    Read the article

  • Optimizing division/exponential calculation

    - by Saltheart
    I've inherited a Visual Studio/VB.Net numerical simulation project that has a likely inefficient calculation. Profiling indicates that the function is called a lot (1 million times plus) and spends about 50% of the overall calculation within this function. Here is the problematic portion Result = (A * (E ^ C)) / (D ^ C * B) (where A-C are local double variables and D & E global double variables) Result is then compared to a threshold which might have additional improvements as well, but I'll leave them another day any thoughts or help would be appreciated Steve

    Read the article

  • Microsoft : « On s'est aimés, on s'est perdus de vue, on se retrouve », entretien avec le Directeur de la division Développeurs

    « On s'est aimés, on s'est perdus de vue, on se retrouve » Entretien avec le Directeur de la division Développeurs de Microsoft France Chez Microsoft, dans l'embrasure d'une porte, il se peut que vous entendiez quelques confessions à coeur ouvert sur un dénommé Vista. Des confidences qui montrent, qu'en interne, cet OS a été vécu par beaucoup comme un accident industriel qui a laissé des traces. Jean Ferré - Directeur de la division Développeurs, Plateforme et Ecosystème de Microsoft France - parle lui plus diplomatiquement d'un « désamour » né entre les développeurs et Microsoft avec Vista. Depuis, Windows 7 est passé par là pour panser les blessures. Et la Build de ...

    Read the article

  • Division by zero: Undefined Behavior or Implementation Defined in C and/or C++ ?

    - by SiegeX
    Regarding division by zero, the standards say: C99 6.5.5p5 - The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined. C++03 5.6.4 - The binary / operator yields the quotient, and the binary % operator yields the remainder from the division of the first expression by the second. If the second operand of / or % is zero the behavior is undefined. If we were to take the above paragraphs at face value, the answer is clearly Undefined Behavior for both languages. However, if we look further down in the C99 standard we see the following paragraph which appears to be contradictory(1): C99 7.12p4 - The macro INFINITY expands to a constant expression of type float representing positive or unsigned infinity, if available; Do the standards have some sort of golden rule where Undefined Behavior cannot be superseded by a (potentially) contradictory statement? Barring that, I don't think it's unreasonable to conclude that if your implementation defines the INFINITY macro, division by zero is defined to be such. However, if your implementation does not define such a macro, the behavior is Undefined. I'm curious what the consensus on this matter for each of the two languages. Would the answer change if we are talking about integer division int i = 1 / 0 versus floating point division float i = 1.0 / 0.0 ? Note (1) The C++03 standard talks about the library which includes the INFINITY macro.

    Read the article

  • How Does Modulus Divison Work

    - by NSWOA
    I don't really understand how modulus division works. I was calculating 27 % 16 and wound up with 11 and I don't understand why. I can't seem to find an explanation in layman's terms online. Can someone elaborate on a very high level as to what's going on here? EDIT: Thanks for all your answers. You guys are incredibly quick. It all makes sense now.

    Read the article

  • sql exception arithmetic overflow?

    - by MyHeadHurts
    In my program the user imports a date and it works whenever the year is in 2011 but if i try a date in 2010 i get this error which is weird [ SqlException (0x80131904): Arithmetic overflow error converting int to data type numeric.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlDataReader.HasMoreRows() +157 System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) +197 System.Data.SqlClient.SqlDataReader.Read() +9 System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +78 System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +164 System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +282 System.Data.Common.LoadAdapter.FillFromReader(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +19 System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler) +222 System.Data.DataTable.Load(IDataReader reader) +14 ( @YearToGet int, @current datetime, @y int, @search datetime ) AS SET @YearToGet = 2006; WITH Years AS ( SELECT DATEPART(year, GETDATE()) [Year] UNION ALL SELECT [Year]-1 FROM Years WHERE [Year]>@YearToGet ), q_00 as ( select DIVISION , DYYYY , sum(PARTY) as asofPAX , sum(InsAmount) as asofSales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year where Booked <= CONVERT(int, DateAdd(year, (Years.Year - @y), @search)) and DYYYY = Years.Year group by DIVISION, DYYYY, years.year having DYYYY = years.year ), q_01 as ( select DIVISION , DYYYY , sum(PARTY) as YEPAX , sum(InsAmount) as YESales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year group by DIVISION, DYYYY , years.year having DYYYY = years.year ), q_02 as ( select DIVISION , DYYYY , sum(PARTY) as CurrentPAX , sum(InsAmount) as CurrentSales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year where Booked <= CONVERT(int,@current) and DYYYY = (year( getdate() )) group by DIVISION, DYYYY ) select a.DIVISION , a.DYYYY , asofPAX , asofSales , YEPAX , YESales , CurrentPAX , CurrentSales ,asofsales/ ISNULL(NULLIF(yesales,0),1) as percentsales, CAST((asofpax) AS DECIMAL(5,1))/yepax as percentpax from q_00 as a join q_01 as b on (b.DIVISION = a.DIVISION and b.DYYYY = a.DYYYY) join q_02 as c on (b.DIVISION = c.DIVISION) JOIN Years as d on (b.dyyyy = d.year) where A.DYYYY <> (year( getdate() )) order by a.DIVISION, a.DYYYY ;

    Read the article

  • Can bad stuff happen when dividing 1/a very small float?

    - by Jeremybub
    If I want to check that positive float A is less than the inverse square of another positive float B (in C99), could something go wrong if B is very small? I could imagine checking it like if(A<1/(B*B)) but if B is small enough, would this possibly result in infinity? If that were to happen, would the code still work correctly in all situations? in a similar vein, I might do if(1/A>B*B) Which might be slightly better because B*B might be zero if B is small (is this true?) Finally, a solution that I can't imagine being wrong is if(sqrt(1/A)>B) Which I don't think would ever result in zero division, but still might be problematic if A is close to zero. So basically, my questions are Can 1/X ever be infinity if X is greater than zero (but small)? Can X*X ever be zero if X is greater than zero? Will comparisons with infinity work the way I would expect them to?

    Read the article

  • What's happening in Red Gate's .NET Developer Tools division?

    .NET 4.0, Silverlight 4, F# decompilation in .NET Reflector, our crazy shipping schedule, and some prize draw winners. Yes, with a list of topics that broad, it can only be another update on what's happening in Red Gate's .NET Developer Tools division....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Calculating pi using infinite series in C#

    - by Jonathan Chan
    Hi! I tried to write the following program in C# to calculate pi using infinite recursion, but I keep getting confused about integer/double/decimal division. I really have no clue why this isn't working, so pardon me for my lack of understanding of strongly typed stuff, as I'm still learning C#. Thanks in advance! using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { public static int Main(string[] args) { int numeratornext = 2; int denominatornext = 5; decimal findto = 100.0M; decimal pi = 0.0M; decimal halfpi = 1.0M; int seriesnum = 1; int seriesden = 3; for (int i = 0; i < findto; i++) { halfpi += Decimal.Divide((decimal)seriesnum, (decimal)seriesden); //System.Console.WriteLine(Decimal.Divide((decimal)seriesnum, (decimal)seriesden).ToString()); seriesnum *= numeratornext; seriesden *= denominatornext; numeratornext++; denominatornext += 2; } pi = halfpi * 2; System.Console.WriteLine(pi.ToString()); System.Console.ReadLine(); return 0; } } }

    Read the article

  • Is 1/0 a legal Java expression?

    - by polygenelubricants
    The following compiles fine in my Eclipse: final int j = 1/0; // compiles fine!!! // throws ArithmeticException: / by zero at run-time Java prevents many "dumb code" from even compiling in the first place (e.g. "Five" instanceof Number doesn't compile!), so the fact this didn't even generate as much as a warning was very surprising to me. The intrigue deepens when you consider the fact that constant expressions are allowed to be optimized at compile time: public class Div0 { public static void main(String[] args) { final int i = 2+3; final int j = 1/0; final int k = 9/2; } } Compiled in Eclipse, the above snippet generates the following bytecode (javap -c Div0) Compiled from "Div0.java" public class Div0 extends java.lang.Object{ public Div0(); Code: 0: aload_0 1: invokespecial #8; //Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: iconst_5 1: istore_1 // "i = 5;" 2: iconst_1 3: iconst_0 4: idiv 5: istore_2 // "j = 1/0;" 6: iconst_4 7: istore_3 // "k = 4;" 8: return } As you can see, the i and k assignments are optimized as compile-time constants, but the division by 0 (which must've been detectable at compile-time) is simply compiled as is. javac 1.6.0_17 behaves even more strangely, compiling silently but excising the assignments to i and k completely out of the bytecode (probably because it determined that they're not used anywhere) but leaving the 1/0 intact (since removing it would cause an entirely different program semantics). So the questions are: Is 1/0 actually a legal Java expression that should compile anytime anywhere? What does JLS say about it? If this is legal, is there a good reason for it? What good could this possibly serve?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >