• Post Reply Bookmark Topic Watch Topic
  • New Topic

defining mathematical symbols  RSS feed

 
macca cronin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm currently trying to write a program that requires me to generate some mathematical formulas. I've been able to use the extended ascii codes to represent some of them using code like below :
int i = 64;
String aChar = new Character((char)i).toString(); //Prints the ascii value of 64

Some operators are not supprted however. I was wondering whether anyone knows how to define the logical connective "and" and "or" symbols ('look like an 'upside-down' V and V respectively), as well as the symbols for universal and existensial quantification. Any help would be greatly appreciated
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They don't show up in my extended ascii-table (256 values, i.e.: �=129).

If you're in a gui-application, you might find a font, where one symbol is used for v and one for ^.

On the console-output-window, it will be more complicated, I guess.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Extended ascii" is a hopelessly vague term nowadays, since there is no single standard for what is represented by values 128-255. You're better off naming the specific encoding scheme used on your machine, like ISO-8859-1 or Cp-1252. Regardless, I'm not aware of any common encoding schemes which include the "and" and "or" symbols, except of Unicode (and its various permutations like UTF-8 and UTF-16). In Unicode, the character values you're looking for are 0x2227 ( ∧ ) and 0x2228 ( ∨ ). In HTML these can be more conveniently represented as ∧ and ∨ respectively. Hope that helps...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!